You are given an integer sequence of length N and another value X. You have to find a contiguous
subsequence of the given sequence such that the sum is greater or equal to X. And you have to findthat segment with minimal length.InputFirst line of the input file contains T the number of test cases. Each test case starts with a linecontaining 2 integers N (1 ≤ N ≤ 500000) and X (−109 ≤ X ≤ 109). Next line contains N integersdenoting the elements of the sequence. These integers will be between −109to 109inclusive.OutputFor each test case output the minimum length of the sub array whose sum is greater or equal to X. Ifthere is no such array, output ‘-1’.Sample Input35 41 2 1 2 16 -2-5 -6 -7 -8 -9 -105 3-1 1 1 1 -1Sample Output3-13
#include #include #include #include #include #include