[codeforces 1294A] Collecting Coins 整除+不整除
总目录详见https://blog.csdn.net/mrcrack/article/details/103564004
在线测评地址http://codeforces.com/contest/1294/problem/A
Problem | Lang | Verdict | Time | Memory |
---|
A - Collecting Coins | GNU C++11 | Accepted | 31 ms | 0 KB |
#include
int main(){int t,a,b,c,n,sum,avg;scanf("%d",&t);while(t--){scanf("%d%d%d%d",&a,&b,&c,&n);sum=a+b+c+n,avg=sum/3;if(sum!=avg*3)printf("NO\n");else{if(a>avg||b>avg||c>avg)printf("NO\n");else printf("YES\n");}}return 0;
}