Mimi is playing more Enur Yrotcaf 4, when she realizes that her damage output is…subpar.
Being a meticulous player, she has tracked her damage output over the last
Wanting to show off to her friends, she wants this interval to be as short as possible. Can you help her find the length of the smallest interval where she deals at least
Constraints
For all subtasks:
Mimi will deal at least
Subtask 1 [10%]
Subtask 2 [30%]
Subtask 3 [60%]
Input Specification
The first line of input will contain two space-separated integers,
The next line of input will contain
Output Specification
The smallest integer -1
if no such subarray exists.
Sample Input 1
5 6
1 3 2 5 0
Sample Output 1
2
Sample Input 2
5 30
1 2 3 4 5
Sample Output 2
-1
Comments
Since the original data were weak, two test cases were added, and all non-contest submissions were rejudged.