Advertisement
SazidAF

D.c

Jan 27th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. long long n, c, rem;
  6. int t, i, j;
  7.  
  8. scanf("%d", &t);
  9.  
  10. for(i = 0; i < t; i++){
  11. scanf("%I64d %I64d", &n, &c);
  12.  
  13. int candy[n];
  14. rem = 0;
  15.  
  16. for(j = 0; j < n; j++){
  17.  
  18. scanf("%d", &candy[j]);
  19. }
  20.  
  21. for(j = 0; j < n; j++){
  22. rem += candy[j];
  23. }
  24.  
  25. if(rem <= c){
  26. printf("Yes\n");
  27. }else {
  28. printf("No\n");
  29. }
  30.  
  31.  
  32. }
  33.  
  34.  
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement