#P16747. [GKS 2020 #A] Allocation
[GKS 2020 #A] Allocation
Problem Description
There are houses for sale. The -th house costs dollars to buy. You have a budget of 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, . test cases follow. Each test case begins with a single line containing the two integers and . The second line contains integers. The -th integer is , the cost of the -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 dollars. You can buy the 1st and 3rd houses for dollars.
In Sample Case #2, you have a budget of dollars. You can buy the 1st, 3rd and 4th houses for dollars.
In Sample Case #3, you have a budget of dollars. You cannot buy any houses (so the answer is ).
Limits
.
.
, for all .
Test Set 1
.
Test Set 2
.