There are multiple test cases.
In the first line of every test case there are two integers n (0<n<=100000) and m (0<=m<=100000), meaning that the sequence contains n integers and m queries.
The next line contains n integers a[i] (1<=i<=n, a[i] <= 109), which represent the integers in the sequence.
After that, there are m lines, each line containing two integers l and r.
Zero thinks that it is too simple for him to solve this problem, so he sets a variable k. In the beginning of each test case, k = 0. For each query, he sets l = l + k and r = r - k, Zero guarantees that 0<l<=r<=n, then make k the answer of this query.
The input ends with EOF.