Simple Adjacency Maximization Find the smallest integer N that has both of the following properties:
- The binary representation of N has exactly P 1’s & exactly Q 0’s. (Leading Zeroes are allowed). 2. The number of 1’s adjacent to one or more 0 in the binary representation is maximized.
Input
The first line of the input file contains a single integer C, the number of test cases in the input file. Each of the next C lines contains two non-negative integers P & Q (1 ≤ P + Q ≤ 50).
Output
For each test case a print the value of N, as explained in the statement, in a line by itself. Sample Input
3 43 11 32
Sample Output
45 1 13