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. scanf("%d%d",&n,&candy);
  7. for(k=0,c=0;k<n;k++) {scanf("%d",&a[k]); c=c+a[k];}
  8. if(candy<c) printf("No");
  9. else printf("Yes");}
  10. return 0;
  11. }
Success #stdin #stdout 0s 2732KB
stdin
2
2 3
1 1
3 7
4 2 2
stdout
YesNo