Banana Bunches

아직 제출이 없습니다시간 제한20초메모리 제한1024 MB

문제

Barbara goes to Alan's banana farm, where the NN banana trees are organized in one long line represented by an array BB. The tree at position ii has B_iB\_i banana bunches. Each tree has the same cost. Once Barbara buys a tree, she gets all the banana bunches on that tree. Alan has a special rule: because he does not want too many gaps in his line, he allows Barbara to buy at most 22 contiguous sections of his banana tree line.

Barbara wants to buy some number of trees such that the total number of banana bunches on these purchased trees equals the capacity KK of her basket. She wants to do this while spending as little money as possible. How many trees should she buy?

입력

The first line of the input gives the number of test cases, TTTT test cases follow.

Each test case begins with a line containing two integers integer NN, the number of trees on Alan's farm, and KK, the capacity of Barbara's basket.

The next line contains NN non-negative integers B_1,B_2,,B_NB\_1,B\_2,\cdots,B\_N representing array BB, where the ii-th integer represents the number of banana bunches on the ii-th tree on Alan's farm.

출력

For each test case, output one line containing Case #x: y, where xx is the test case number (starting from 11) and yy is the minimum number of trees Barbara must purchase to obtain KK banana bunches using at most 22 contiguous sections of the farm, or -1 if it is impossible to do so.

제한

  • 1T1001 \le T \le 100.
  • 0B_iK0 \le B\_i \le K, for each ii from 11 to NN.