Chef And Work :) (Codechef August Cook-Off Contest Problem)
Question:- Chef has N small boxes arranged on a line from 1 to N . For each valid i , the weight of the i -th box is W i . Chef wants to bring them to his home, which is at the position 0 . He can hold any number of boxes at the same time; however, the total weight of the boxes he's holding must not exceed K at any time, and he can only pick the i-th box if all the boxes between Chef's home and the i-th box have been either moved or picked up in this trip. Therefore, Chef will pick up boxes and carry them home in one or more round trips. Find the smallest number of round trips he needs or determine that he cannot bring all boxes home. Input The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows. The first line of each test case contains two space-separated integers N and K . The second line contains N ...