#P8567. [JRKSJ R6] Nothing
[JRKSJ R6] Nothing
Background
[An image should be here.]
Problem Description
We define as the position of the lowest in the binary representation of (note that the lowest bit in binary is bit ). The following is the code in C++ (without considering issues caused by data types):
int f(int x){
int ans = 0;
while (x % 2 == 0){
x /= 2;
ans += 1;
}
return ans;
}
There are queries. For each query, given an interval , find how many integers satisfy .
Input Format
The first line contains a positive integer .
The next lines each contain two positive integers , representing one query.
Output Format
Output lines, each containing one integer, the answer.
2
3 5
15 20
2
3
Hint
Constraints
This problem uses bundled testdata.
| Special constraints | |||
|---|---|---|---|
| None |
For of the testdata, , .
Translated by ChatGPT 5