AdvancedRating 2000
Shortest Block With Sum at Least k
Numbers may be negative. Print the length of the shortest block of consecutive numbers with sum ≥ k, or -1.
Input
n and k, then n integers.
Output
One integer.
Sample 1
Input
1 1 1
Output
1
Sample 2
Input
2 4 1 2
Output
-1
Output appears here