#P7567. 「MCOI-05」魔仙

「MCOI-05」魔仙

Background

You are the astrology magic fairy in the Magic Fairy Castle.

Problem Description

The Magic Fairy Queen’s gem was stolen by the ancient "Gunalab Dark God". The "Gunalab Dark God" is hiding in any one of the nn domes in the Magic Fairy Castle. These nn domes are numbered from 11 to nn. The ii-th dome can be assigned a magic power value aia_i, and aia_i must be an integer.

If the sum of the magic power values of all domes is 00 and their product is nn, then we say that in this situation, the "Gunalab Dark God" can be found easily.

The Magic Fairy Queen asks the astrology magic fairy to find an assignment of magic power values so that the "Gunalab Dark God" can be found easily.

Input Format

This problem has multiple test cases.

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

The next TT lines each contain one integer nn.

Output Format

Output TT lines. The ii-th line should contain the answer for the ii-th test case.

If there is a solution, output one line with nn integers representing a constructed sequence of magic power values. Otherwise, output w33zAKIOI.

This problem uses Special Judge, so you only need to output one valid sequence.

2
4
114513
1 -1 2 -2
w33zAKIOI
1
1
w33zAKIOI

Hint

Sample 1 Explanation

1+(1)+2+(2)=01 + (-1) + 2 + (-2) = 0, 1×(1)×2×(2)=41 \times (-1) \times 2 \times (-2) = 4.

Constraints

This problem uses bundled tests.

  • Subtask 1 (5 pts): n1n \le 1
  • Subtask 2 (20 pts): n,n100n, \sum n \le 100
  • Subtask 3 (75 pts): no special constraints.

For 100%100\% of the testdata, 1n1061 \le n \le 10^6, n5×106\sum n \le 5 \times 10^6, 1T1051 \le T \le 10^5.

This problem uses Special Judge, so you only need to output one valid sequence.

Translated by ChatGPT 5