CF1828A.Divisible Array

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Divisible Array

You are given a positive integer nn. Please find an array a1,a2,,ana_1, a_2, \ldots, a_n that is perfect.

A perfect array a1,a2,,ana_1, a_2, \ldots, a_n satisfies the following criteria:

  • 1ai10001 \le a_i \le 1000 for all 1in1 \le i \le n.
  • aia_i is divisible by ii for all 1in1 \le i \le n.
  • a1+a2++ana_1 + a_2 + \ldots + a_n is divisible by nn.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1t2001 \le t \le 200). The description of the test cases follows.

The only line of each test case contains a single positive integer nn (1n2001 \le n \le 200) — the length of the array aa.

Output

For each test case, output an array a1,a2,,ana_1, a_2, \ldots, a_n that is perfect.

We can show that an answer always exists. If there are multiple solutions, print any.

Note

In the third test case:

  • a1=1a_1 = 1 is divisible by 11.
  • a2=2a_2 = 2 is divisible by 22.
  • a3=3a_3 = 3 is divisible by 33.
  • a1+a2+a3=1+2+3=6a_1 + a_2 + a_3 = 1 + 2 + 3 = 6 is divisible by 33.

In the fifth test case:

  • a1=3a_1 = 3 is divisible by 11.
  • a2=4a_2 = 4 is divisible by 22.
  • a3=9a_3 = 9 is divisible by 33.
  • a4=4a_4 = 4 is divisible by 44.
  • a5=5a_5 = 5 is divisible by 55.
  • $a_1 + a_2 + a_3 + a_4 + a_5 = 3 + 4 + 9 + 4 + 5 = 25$ is divisible by 55.

Samples

7
1
2
3
4
5
6
7
1
2 4
1 2 3
2 8 6 4
3 4 9 4 5
1 10 18 8 5 36
3 6 21 24 10 6 14

在线编程 IDE

建议全屏模式获得最佳体验