#P10306. 「Cfz Round 2」How to Prove

    ID: 11330 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>数学洛谷原创Special JudgeO2优化构造洛谷月赛

「Cfz Round 2」How to Prove

Problem Description

Given a positive integer nn.

We define that for a set SS, Ω(S)\Omega(S) is the set consisting of the sums of elements of all non-empty subsets of SS.

Formally, $\Omega(S)=\{x\mid x=\sum\limits_{i\in T}i,T\subseteq S,T\neq \varnothing\}$.

For example, when S={2,0,3,5}S=\{2,0,-3,5\}, Ω(S)={3,1,0,2,4,5,7}\Omega(S)=\{-3,-1,0,2,4,5,7\}.

You need to construct a set SS of size nn such that:

  • All elements in SS are integers not greater than 10910^9 and not less than 109-10^9.
  • Ω(S)|\Omega(S)| is minimized, i.e., Ω(S)\Omega(S) contains as few elements as possible.

Input Format

This problem has multiple test cases.

The first line contains an integer TT, representing the number of test cases.

Then each test case is given as follows. For each test case, one line contains a positive integer nn.

Output Format

For each test case, output one line with nn integers, representing all elements in the set SS you constructed.

Any output that satisfies the requirements will be accepted.

3
1
2
4
3
0 5
2 0 -2 4

Hint

"Sample Explanation #1"

For the 11st test case, S={3}S=\{3\}, Ω(S)={3}\Omega(S)=\{3\}. Of course, {0}\{0\}, {2}\{-2\}, etc. are also valid sets SS.

For the 22nd test case, S={0,5}S=\{0,5\}, Ω(S)={0,5}\Omega(S)=\{0,5\}.

For the 33rd test case, S={2,0,2,4}S=\{2,0,-2,4\}, Ω(S)={2,0,2,4,6}\Omega(S)=\{-2,0,2,4,6\}.

It can be proven that the above constructions all satisfy the requirements.

Constraints

Let n\sum n denote the sum of nn within a single test case file.

For all testdata, 1T1001 \le T \le 100, 1n1061 \le n \le 10^6, n106\sum n \le 10^6.

You can get the score for this problem only if you pass all test cases.

Translated by ChatGPT 5