Minimal Subarray Length#6951

Minimal Subarray Length

3 saniye
128 megabayt
Çok kolay

You are given an integer sequence of length and another value .

You have to find a contiguous subsequence of the given sequence such that the sum is greater or equal to . And you have to find that segment with minimal length.

Giriş

First line of the input file contains the number of test cases. Each test case starts with a line containing integers (1 \leq N \leq 500000) and (-10^9 \leq X \leq 10^9). Next line contains integers denoting the elements of the sequence. These integers will be between -10^9 to 10^9 inclusive.

Çıktı

For each test case output the minimum length of the sub array whose sum is greater or equal to . If there is no such array, output .

Örnekler

Örnek 1

Loading
Loading