#P16747. [GKS 2020 #A] Allocation

[GKS 2020 #A] Allocation

Problem Description

There are NN houses for sale. The ii-th house costs AiA_i dollars to buy. You have a budget of BB dollars to spend.

What is the maximum number of houses you can buy?

Input Format

The first line of the input gives the number of test cases, TT. TT test cases follow. Each test case begins with a single line containing the two integers NN and BB. The second line contains NN integers. The ii-th integer is AiA_i, the cost of the ii-th house.

Output Format

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the maximum number of houses you can buy.

3
4 100
20 90 40 90
4 50
30 30 10 10
3 300
999 999 999
Case #1: 2
Case #2: 3
Case #3: 0

Hint

In Sample Case #1, you have a budget of 100100 dollars. You can buy the 1st and 3rd houses for 20+40=6020+40=60 dollars.

In Sample Case #2, you have a budget of 5050 dollars. You can buy the 1st, 3rd and 4th houses for 30+10+10=5030+10+10=50 dollars.

In Sample Case #3, you have a budget of 300300 dollars. You cannot buy any houses (so the answer is 00).

Limits

1T1001 \le T \le 100.

1B1051 \le B \le 10^5.

1Ai10001 \le A_i \le 1000, for all ii.

Test Set 1

1N1001 \le N \le 100.

Test Set 2

1N1051 \le N \le 10^5.