You want to move from position to position on a number line. At position , you may move right by any integer from through .
Find the minimum number of moves required to reach position exactly. Print t{-1} if it is unreachable.
Input
The input is given in the following format:
case case case
Each test case is given in the following format:
Output
For each test case, print the minimum number of moves on one line. Print -1 if position is unreachable.
Constraints
- .
- .
- ().
- The sum of over all test cases does not exceed .
Subtasks
Samples
입력
2
5
2 3 1 1 0
5
1 0 5 5 0
출력
2
-1