Roger is training for CCO and has decided to practice implementing rage trees. He decides to solve a classic problem that is solvable with rage trees.
Given an array with
Constraints
The elements of the array are positive integers up to a million.
Input Specification
The first line contains two integers,
Each of the next
Each of the next
Output Specification
For each query, print on a separate line the range of the subarray with leftmost index
Sample Input
Copy
6 3
1
7
3
4
2
5
1 5
4 6
2 2
Sample Output
Copy
6
3
0
Comments
why am i getting presentation error: https://dmoj.ca/submission/5779275
The output of your submission does not match the output format of the problem. If you tried the sample case locally, you'd see why.
but i have tried it in an editor and the sample case works fine
If your editor is somehow displaying output incorrectly you can also see the output of your program on the first testcase in DMOJ by clicking on the arrow on the left.