Given an array
Count the number of elements appearing exactly once in the range
Constraints
Input Specification
The first line contains
The second line contains
The next
Output Specification
For each query output one integer on its own line, the answer to that query.
Sample Input
Copy
7 5
1 2 3 2 4 3 1
2 5
1 7
4 7
3 6
1 1
Sample Output
Copy
2
1
4
2
1
Comments