fork(1) download
  1. #include<stdio.h>
  2. int main(){
  3. int n,c,t,k,a[100];
  4. long unsigned int candy;
  5. for(scanf("%d",&t);t>0;t--){
  6. printf("t : %d ",t);
  7. scanf("%d %llu",&n,&candy);
  8. for(k=0,c=0;k<n;k++) {scanf("%d",&a[k]); c=c+a[k];}
  9. if(candy<c) printf("No");
  10. else printf("Yes");printf(" t : %d ",t);}
  11. return 0;
  12. }
Success #stdin #stdout 0s 2688KB
stdin
2
2 3
1 1
3 7
4 2 2
stdout
t : 2 Yes t : 0