An array A contains integers with the following constraints:
You are given Q queries of type:
Note: 1-based indexing is followed.
Input format
Output format
For each query in a new line, print the required number of distinct values.
Constraints
1≤Q≤1051≤L≤R≤1013
First few elements of the array A are 1,1,2,2,2,3,3,3,3,3,...