fork download
  1. #include <stdio.h>
  2. int main(void) {
  3. int i, j, a, w;
  4. scanf("%d", &i);
  5. while(i--){
  6. scanf("%d", &w);
  7. for(j=0; j<9; j++){
  8. scanf("%d", &a);
  9. w-=a;
  10. }
  11. printf("%s\n", (w<0)?"NO":"YES");
  12. }
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2296KB
stdin
3
90
10 10 10 10 10 10 10 10 10
1000
77 77 70 11 34 35 41 83 54
50
10 20 30 40 50 60 50 40 30
stdout
YES
YES
NO