| Insomnia-26 |
|---|
| Finished |
You are given two integers $$$n$$$ and $$$m$$$.
Find the number of ordered pairs $$$(a, b)$$$ that satisfy:
Note that $$$|$$$ denotes the bitwise OR operator.
The first line of input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. Description of each testcase follows.
Each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 10^6 $$$).
It is guaranteed that the sum of $$$n$$$ over all testcases does not exceed $$$10^6$$$ and the sum of $$$m$$$ over all testcases does not exceed $$$10^6$$$.
For each testcase, print the answer on a separate line.
56 720 20998 244353 4201000 1000
9625475933850200
| Name |
|---|


