题号:NC273391
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
Alice needs to transport a total of

items. Let's label each item with numbers from

to

. Alice has a magic power that allows her to transport items with a total weight not exceeding

at once.
Now Alice has a question: for the first

items, under the condition that
the i-th item must be selected, as many items as possible should be chosen from the first

items to be transported using magic. At this point, what is the minimum number of remaining items among the first

items?
Reminder: There may be items with a weight of 0 in the data.
输入描述:
The first line contains the number of test cases

(

).
For each test case, the first line contains the number of items

and the total weight

for magic transportation.
The next line contains

integers, representing the weight

of each item.
输出描述:
For each test case, output one line containing

integers. The

-th integer represents the number of remaining items after applying magic as required for the first

items.
示例1
输入
复制
2
7 15
1 2 3 4 5 6 7
5 100
80 40 40 40 60
备注: