Problem Statement
Josh does not like research. In particular, he can model the FIT2083 classes of the semester as an array, of which the i-th value is equal to the number of Depression Points he will gain from attending it. Furthermore, Josh knows that if the number of Depression Points he obtains exceeds , he will die.
Given this array, Josh wonders: What is the smallest number of consecutive classes he can attend and die as a result?
Input Format
The first line of the input will consist of two integers, and . The second line of input will consist of numbers, representing the array described in the problem.
Output Format
Output a single integer, the smallest number of consecutive classes he can attend in order to die. If this is not possible, output -1.
Constraints
Sample Input 1
5 11
5 10 1 4 5
Sample Output 1
2
Sample Explanation 1
The shortest window of classes with a sum of Depression Points exceeding 11 is the first and second element, which is of length 2.
Comments