| BSUIR Open XIII: School final |
|---|
| Finished |
We define the bitwise characteristic of a positive integer $$$n$$$ as the number of pairs of integers $$$i$$$ and $$$j$$$ ($$$1 \le i \lt j$$$) such that $$$i \oplus j = n$$$ and $$$i \mid j = n$$$.
Calculate the value of the bitwise characteristic of the given integer $$$n$$$.
$$$\oplus$$$ denotes the bitwise XOR operation.
$$$\mid$$$ denotes the bitwise OR operation.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the integer for which the bitwise characteristic needs to be determined.
For each test case, output a single integer — the value of the bitwise characteristic of the integer $$$n$$$.
36842
1 0 3
In the first test case, there is only one suitable pair: $$$(2, 4)$$$.
In the second test case, there are no suitable pairs.
In the third test case, the following suitable pairs exist: $$$(2, 40)$$$, $$$(8, 34)$$$, and $$$(10, 32)$$$.
| Name |
|---|


