H4ck3rm4n

0

0 votes
Very-Easy
Problem

Elliot is cyber security specialist working for Evil Corp.
Elliot has a script that outputs two integers N1 and N2 after scanning the cryptocurrency blocks for exploits.
He gives these numbers as report to his employer Terry, CEO of Evil Corp.
Terry decides to use this to his advantage, he knows that if he puts this number in the cryptocurrency block exploits he can earn cryptocurrency worth the XNOR of N1 and N2.
He also finds out that he can interchange the bits of the number and can still use it. Can you help him use this to maximize the profit so that he gives you a share out of the money laundered.

INPUT
The First Line of Input Contains the number of test cases T.
Then each of the T lines contains two integers N1 and N2.

CONSTRAINT
1 ≤ Number of bits in N1 and N2 ≤ 60
Number of bits in output ≤ Max number of bits (N1, N2)

OUTPUT
For each N1 and N2 output the greatest possible profit in a newline.

Time Limit: 1.25
Memory Limit: 256
Source Limit:
Explanation

N1 = (70)10 = (0001000110)2
N2 = (774)10 = (1100000110)2

So the max result can be obtained by XNORing (1110000000)2 and (1110000001)2 i.e. (1111111110)2 or (1022)10.

Editor Image

?