| SashaT9 Contest 1 |
|---|
| Finished |
You are given an integer $$$n$$$. Find all values of $$$x$$$ where $$$1 \le x \le 2^{100}$$$, such that $$$[1 \oplus x, 2 \oplus x, \dots , n \oplus x]$$$ forms a permutation of size $$$n$$$.
The first line contains a single integer $$$n$$$ ($$$1\le n \lt 2^{30}$$$).
If there are no such values of $$$x$$$, output $$$-1$$$. Otherwise, output all valid $$$x$$$.
6
7
3
-1
In the first sample, for $$$n=6$$$, only $$$x=7$$$ satisfies the condition:
$$$[1\oplus \color{orange}{7}, 2\oplus \color{orange}{7}, 3\oplus \color{orange}{7}, 4\oplus \color{orange}{7}, 5\oplus \color{orange}{7}, 6\oplus \color{orange}{7}]=[6, 5, 4, 3, 2, 1]$$$.
| Name |
|---|


