Biggest Bitwise-Or
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Description
Given two natural numbers , you need to choose two integers that satisfy , and maximize .
The operator represents bitwise-or operation.
Format
Input
The first line contains one integer --- the number of test cases.
Each test case consists of one line containing two integers .
Output
For each test case, print a single integer --- the maximum bitwise-or result .
Samples
4
1 10
0 1
1023 1024
233 322
15
1
2047
511