#K45262. Candies Distribution
Candies Distribution
Candies Distribution
Chef wants to distribute candies among his friends. For each test case, you are given the number of friends N, the total number of candies C, and a list of candy requirements for each friend. Chef can satisfy his friends if the total required candies do not exceed the available candies, i.e., if $$\sum_{i=1}^{N} a_i \leq C$$. Otherwise, the supply is insufficient. Your task is to determine, for each test case, whether Chef has enough candies.
inputFormat
The input begins with an integer T, the number of test cases. Each test case consists of two lines. The first line contains two integers N and C, where N is the number of friends and C is the total number of candies. The second line contains N integers, each representing the candy requirement of a friend. Input is read from stdin.
outputFormat
For each test case, print a single line with the result: "YES" if the sum of the candy requirements is less than or equal to C, and "NO" otherwise. Output is written to stdout.## sample
2
4 10
2 3 1 2
3 10
5 5 5
YES
NO
</p>