Description
Input
修正一下
l = (l_0 + x - 1) mod n + 1, r = (r_0 + x - 1) mod n + 1
Output
Sample Input
6 31 2 3 2 1 2
1 5
3 6
1 5
Sample Output
12
1
Hint
修正下:
n <= 40000, m <= 50000
修正一下
l = (l_0 + x - 1) mod n + 1, r = (r_0 + x - 1) mod n + 1
修正下:
n <= 40000, m <= 50000