Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- long long n, c, rem;
- int t, i, j;
- scanf("%d", &t);
- for(i = 0; i < t; i++){
- scanf("%I64d %I64d", &n, &c);
- int candy[n];
- rem = 0;
- for(j = 0; j < n; j++){
- scanf("%d", &candy[j]);
- }
- for(j = 0; j < n; j++){
- rem += candy[j];
- }
- if(rem <= c){
- printf("Yes\n");
- }else {
- printf("No\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement