Second Binary Digit
Submissions: 706   Accuracy:

8.94%

  Difficulty: Easy   Marks: 2

Given two numbers a and b find all the number between the given range whose second least significant digit in the binary representation of the number is 1.

Input:
The line contains T i.e. number of test cases. The next T line contains two integers a and b each.

Output:
For each of the test case print the corresponding answer in separate lines.

Constraints:
1<= T <= 10^5
1 <= a<=b <=10^9

Example:
Input

1
1 4
Output
2

Explanation
In the given range 2 (10) and 3 (11) are the numbers whose second least significant digit in its binary representation is 1.

** For More Input/Output Examples Use 'Expected Output' option **

Author: ShivamKD


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.