#P16220. [ECUSTPC 2025] 浮点
[ECUSTPC 2025] 浮点
Problem Description
Maddy encountered a machine. In front of the machine, she needs to report a long sequence of numbers so that she can obtain the Crystal Heart.
The machine first tells Maddy an integer . Specifically, the sequence must satisfy the following:
- The sequence consists of integers within , denoted as .
- For all , it holds that and $a_i \text{ xor } a_{i+1} < a_i \text{ and } a_{i+1}$.
Please help Maddy find such a sequence, or tell Maddy that no solution exists.
Input Format
The first line contains an integer (), representing the number of testdata.
The only line of each testdata contains an integer (), representing the number given by the machine to Maddy.
It is guaranteed that over all testdata.
Output Format
For each testdata, if such a sequence exists, output one line with integers representing a sequence that satisfies the machine’s requirements. If it does not exist, output a single integer in one line.
If there are multiple valid answers, you may output any one of them.
4
2
3
4
5
9 15
4 5 6
9 10 12 15
8 9 10 11 12
Hint
Sample 1 Explanation
For the 1st sample, , and , so . It is also easy to see that .
For the 2nd sample,
- , and , so . It is also easy to see that .
- , and , so . It is also easy to see that .
Hint
For two integers and , denotes the bitwise XOR, meaning a bit in the binary representation of the result is 1 if and only if in the binary representations of the original numbers, exactly one of them has a 1 at that bit.
For two integers and , denotes the bitwise AND, meaning a bit in the binary representation of the result is 1 if and only if in the binary representations of the original numbers, both have a 1 at that bit.
Translated by ChatGPT 5