Problem G. Find the answer
时间限制 1 ms
内存限制 64 MB
Given a sequence of n integers called W and an integer m. For each i (1 <= i <= n), you can choose some elements $W_k$ (1 <= k < i), and change them to zero to make $\sum_{j=1}^i$$W_j$<=m. So what's the minimum number of chosen elements to meet the requirements above?.
输入数据
输出数据
For each test case, you should output n integers in one line: i-th integer means the minimum number of chosen elements $W_k$ (1 <= k < i), and change them to zero to make $\sum_{j=1}^i$$W_j$<=m.
样例输入
复制
2
7 15
1 2 3 4 5 6 7
5 100
80 40 40 40 60
样例输出
复制
0 0 0 0 0 2 3
0 1 1 2 3
$ Mathjax font initiator $