fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int test;
  7. cin>>test;
  8. while(test--)
  9. { int num;
  10. int c,ele;
  11. cin>>num>>c;
  12.  
  13. for(int i=0;i<num;i++)
  14. { cin>>ele;
  15. c-=ele;
  16. }
  17. if(c<0)
  18. { cout<<"NO"<<endl;
  19. }
  20. else
  21. { cout<<"YES"<<endl;
  22. }
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 2688KB
stdin
2
2 3
1 1
3 7
4 2 2
stdout
YES
NO