Clarke and food

Time Limit: 1000ms
Memory Limit: 65536KB
This problem will be judged on HDU. Original ID: 5562
64-bit integer IO format: %I64d      Java class name: Main

Description

Clarke is a patient with multiple personality disorder. One day, Clarke turned into a cook, was shopping for food.
Clarke has bought $n$ food. The volume of the $i$th food is $v_i$. Now Clarke has a pack with volume $V$. He wants to carry food as much as possible. Tell him the maxmium number he can brought with this pack.

Input

The first line contains an integer $T(1 \le T \le 10)$, the number of the test cases.
For each test case:
The first line contains two integers $n, V(1 \le n \le 10^5, 1 \le V \le 10^9)$.
The second line contains $n$ integers, the $i$th integer denotes $v_i(1 \le v_i \le 10^9)$.

Output

For each test case, print a line with an integer which denotes the answer.

Sample Input

1
3 5
1 3 4

Sample Output

2

Hint:  
We can carry 1 and 3, the total volume of them is 5.

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .