Given integers and , select distinct integers from the range i.e. \{1,2,3,...,n\} such that their bitwise OR is maximized. B : ATTENTION !! : This is very important , you must solve this problem via recursive dfs over bits , otherwise you'll disappoint the writer of the round and you'll end up in a touch-grass situation.
Formally , among all tuples of \{1,2,3,...,n\} , choose any tuple such that a_1 | a_2 | a_3 | .. | a_k is maximized among all tuples and report its value.
The first line contains single integer (1 \le t \le 10^4) — the number of test cases
The only line of each test case contains two integer (1 \le k \le n \le 10^{18}) — the length of required range and the length of tuple.
Output lines, the i_\text{th} line contains the answer to the i_\text{th} test case.
Example 1
For the first test case, we can choose and 1 \mid 2 \mid 4 = 7.
For the second test case, we can choose .
Subtask ( points): (\sum n \le 20)
Subtask ( points): No additional constraints