# Chef and Work SOLUTIONS CHEFNWRK

Page Contents

### Chef and Work SOLUTIONS CHEFNWRK

Chef expert has N little boxes organized on a line from 1 to N. For each substantial I, the heaviness of the I-th box is Wi. Culinary expert needs to carry them to his home, which is at the position 0. He can hold quite a few boxes simultaneously; be that as it may, the all out weight of the containers he’s holding must not surpass K whenever, and he can possibly pick the ith box if all the cases between Chef’s home and the ith box have been either moved or gotten in this excursion.

Thusly, Chef will get boxes and convey them home in at least one trips there and back. Locate the most modest number of trips there and back he needs or establish that he can’t bring all cases home.

Info

The principal line of the info contains a solitary number T meaning the quantity of experiments. The portrayal of T experiments follows.

The primary line of each experiment contains two space-isolated whole numbers N and K.

The subsequent line contains N space-isolated whole numbers W1,W2,… ,WN.

Yield

For each experiment, print a solitary line containing one whole number ― the most modest number of full circle trips or −1 in the event that it is unimaginable for Chef to bring all cases home.

Requirements

1≤T≤100

1≤N,K≤103

1≤Wi≤103 for each legitimate I

Model Input

2 4

3 6

3 4 2

3 6

3 4 3

Model Output

– 1

Clarification

Model case 1: Since the heaviness of the case higher than K, Chef can not convey that case home in quite a few the full circle.

Model case 2: Since the aggregate of loads of both boxes is not as much as K, Chef can convey them home in one full circle.

Model case 3: In the first full circle, Chef can just get the case at position 1. In the second full circle, he can get both remaining boxes at positions 2 and 3.

Model case 4: Chef can just convey each crate in turn, so three trips there and back are required.