At the University of Squirreloo, first-year squirrels in the math faculty have to take MATH 137: calculus, everyone's favourite branch of math! In this course they learn about convergent sequences, where values in a sequence get arbitrarily close to a limit. However, said sequences are infinite, and infinity is a concept too difficult to tackle immediately for our young squirrels, so they'll first discuss sequences of finite length - namely, an array of length
Constraints
For this problem, you will be required to pass all the samples in order to receive any points. In addition, you must pass all previous subtasks to earn points for a specific subtask.
For all subtasks:
Subtask 1 [18%]
Subtask 2 [82%]
No additional constraints.
Input Specification
On the first line will be two integers
The second line will contain
The following
Output Specification
This problem is graded with an identical
checker. This includes whitespace characters. Ensure that every line of output is terminated with a \n
character and that there are no trailing spaces.
Output
Sample Input 1
8 5
1 5 4 6 -2 3 4 0
0 4
2 2
1 5
-1 0
5 5
Sample Output 1
4
3
8
0
3
Sample Input 2
5 5
1 2 3 4 5
5 1
4 1
2 2
2 3
1 5
Sample Output 2
2
3
0
5
5
Comments
off-by-ones make my brain hurt