409383: GYM103495 I Fake Walsh Transform
Description
There is a set of integer $$$\{0,1,2,\ldots, 2^m-1\}$$$. Now you need to select $$$k$$$ integers from the set. Each integer should be selected no more than once. Let's denote the integers you selected by $$$a_1,a_2,\ldots, a_k$$$. You should make sure that $$$a_1\oplus a_2\oplus \ldots \oplus a_k=n$$$, where $$$\oplus$$$ indicates the bitwise exclusive OR operation.
You want to make $$$k$$$ as large as possible. Please calculate the maximum $$$k$$$.
InputThe first line contains one integer $$$T$$$ ($$$1\le T\le 10^4$$$), indicating the number of test cases.
For each test case, the only line contains two integers $$$m$$$ and $$$n$$$ ($$$1\le m\le 60$$$, $$$0\le n < 2^m$$$).
OutputFor each test case, output one integer in a single line, indicating the maximum $$$k$$$.
ExampleInput1 2 2Output
3Note
For example, we can select $$$\{0,1,3\}$$$ from the set, since $$$0\oplus1\oplus3=2$$$.