Re: Test 1
Test #1 describe into problem statement.
10 3 3
4 5 1
What it means, we have range [0, 10] and start position in 3. And have 3 shifts.
First shift we can go from 3 to [-1, 7] as -1 not in range we have only [7] positions.
Second shift we can go to positions [2, 12] as 12 not in range we have only [2] position.
Third shift we can go to positions [1, 3] as all of them in range we have 2 possible final states 1 and 3, minimal of them 1 and maximal 3. Answer will be 1 3.
Another test:
100 50 4
1 2 4 8
Possible positions on steps:
0) [50]
1) [49, 51]
2) [47, 49, 51, 53]
3) [43, 45, 47, 49, 51, 53, 55, 57]
4) [35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65]
Answer will be 35 65