coderforce A.Ilya and Diplomas

题意: a>b>c,a+b+c=n

告诉你a,b,c的取值范围,让你构造出a,b,c的值

#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        int a,b,c,d,e,f;
        scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
        int k=min(b,n-c-e);
        n-=k;
        int m=min(d,n-e);
        printf("%d %d %d\n",k,m,n-m);
    }
    return 0;
}

你可能感兴趣的:(coderforce A.Ilya and Diplomas)