Codeforces Round 796 (Div. 2)
A
Cirno's Perfect Bitmasks Classroom
Codeforces
800
原题
←B →
翻译中…

Even if it's a really easy question, she won't be able to answer it— Perfect Memento in Strict Sense

翻译中…

Cirno's perfect bitmasks classroom has just started!

翻译中…

Cirno gave her students a positive integer $x$. As an assignment, her students need to find the minimum positive integer $y$, which satisfies the following two conditions:

翻译中…

$$x\ \texttt{and}\ y \gt 0$$ $$x\ \texttt{xor}\ y \gt 0$$

翻译中…

Where $\texttt{and}$ is the bitwise AND operation, and $\texttt{xor}$ is the bitwise XOR operation.

翻译中…

Among the students was Mystia, who was truly baffled by all these new operators. Please help her!

翻译中…

Input

翻译中…

The first line of input contains a single integer $t$ ($1 \leq t \leq 10^3$) — the number of input test cases.

翻译中…

For each test case, the only line of input contains one integer $x$ ($1 \leq x \leq 2^{30}$).

翻译中…

Output

翻译中…

For each test case, print a single integer — the minimum number of $y$.

翻译中…

Note

翻译中…

Test case 1:

翻译中…

$1\; \texttt{and}\; 3=1 \gt 0$, $1\; \texttt{xor}\; 3=2 \gt 0$.

翻译中…

Test case 2:

翻译中…

$2\; \texttt{and}\; 3=2 \gt 0$, $2\; \texttt{xor}\; 3=1 \gt 0$.

翻译中…

样例

Input #1
7
1
2
5
9
16
114514
1000000
Output #1
3
3
1
1
17
2
64
InputCopy OutputCopy
题目信息
题号
1688A
时间限制
1 s
内存限制
256 MB
标签
位运算
暴力

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。