fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(void)
  6. {
  7. int t;
  8. cin >> t;
  9.  
  10. while (t--)
  11. {
  12. int w, temp, sum = 0;
  13. cin >> w;
  14.  
  15. for (int i = 0; i < 9; i++)
  16. {
  17. cin >> temp;
  18. sum += temp;
  19. }
  20. if (w >= sum) cout << "YES" << endl;
  21. else cout << "NO" << endl;
  22. }
  23. }
Success #stdin #stdout 0s 5564KB
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