Elephants and Spider Web

0

0 votes
Easy
Problem

"N elephants went out to play on a spider web one day". Having a set of M elephants, each one with a weight wi where 1iM, and knowing the maximum weight that the spider web supports, what is the largest number of elephants that you can put in the spider web without breaking it?

Input:

The first line of input contains a non negative integer meaning the number of test cases. Each case starts with a line with two integers M and W, the number of elephants and the maximum weight that the spider web supports (1M105 and 1W108). The next line contains M numbers wi representing the weight of each elephant (1wi10000).

Output

Print a single line per test case with the largest number of elephants that you can put in the spider web without breaking it.

Sample Input
3
5 14
10 15 16 17 18
4 20
1 2 3 4
5 22
9 1 8 7 7
Sample Output
1
4
3
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?