Consider two non-negative long integers, and , where . The bitwise AND of all long integers in the inclusive range between and can be expressed as , where is the bitwise AND operator.
Given pairs of long integers, and , compute and print the bitwise AND of all natural numbers in the inclusive range between and .
For example, if and , the calculation is .
Complete the andProduct in the editor below. It should return the computed value as an integer.
andProduct has the following parameter(s):
The first line contains a single integer , the number of intervals to test.
Each of the next lines contains two space-separated integers and .
For each pair of long integers, print the bitwise AND of all numbers in the inclusive range between and on a new line.
Sample Input 0
Sample Output 0
There are three pairs to compute results for:
Sample Input 1
Sample Output 1