#P11785. 「FAOI-R4」手写的从前
「FAOI-R4」手写的从前
Description
Little loves non-negative integer powers of .
He asks you to construct an integer sequence that satisfies the following conditions:
- Its length is a non-negative integer power of .
- Its elements are all non-negative integer powers of .
- The sum of its elements is .
That's still too easy. Therefore, you are asked to minimize the length of the sequence, and based on this, minimize the lexicographic order of the sequence.
It can be proven that a proper solution always exists under the given constraints.
Input Format
The first line of input contains a single integer , denoting the number of test cases. The description of test cases follows.
The first and only line of each test case contains a single integer .
Output Format
For each test case, output a single line containing a series of numbers, separated by space, as your constructed sequence. It is guaranteed the sum of the lengths of the answer sequences of each test case does not exceed .
2
5
6
1 4
2 4
Hint
Sample Explanation
are all non-negative integer powers of .
The sequence contains all non-negative integer powers of , has a sum of , and has a length of , also a non-negative integer power of .
It can be proven that there is no sequence of strict shorter length nor smaller lexicographic order, hence the answer is sequence . So is the case for .
Constraints
| Testdata ID | ||
|---|---|---|
For all tests, it's guaranteed that , and the sum of the lengths of the answer sequences of each test case does not exceed . Each test is worth points.
京公网安备 11011102002149号