CF1983A.Array Divisibility

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

Array Divisibility

An array of integers a1,a2,,ana_1,a_2,\cdots,a_n is beautiful subject to an integer kk if it satisfies the following:

  • The sum of aja_{j} over all jj such that jj is a multiple of kk and 1jn1 \le j \le n, itself, is a multiple of kk.
  • More formally, if umkjajum_{k | j} a_{j} is divisible by kk for all 1jn1 \le j \le n then the array aa is beautiful subject to kk. Here, the notation kj{k|j} means kk divides jj, that is, jj is a multiple of kk.

Given nn, find an array of positive nonzero integers, with each element less than or equal to 10510^5 that is beautiful subject to all 1kn1 \le k \le n.

It can be shown that an answer always exists.

Input

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

The first and only line of each test case contains a single integer nn (1n1001 \le n \le 100) — the size of the array.

Output

For each test case, print the required array as described in the problem statement.

Note

In the second test case, when n=6n = 6, for all integers kk such that 1k61 \le k \le 6, let SS be the set of all indices of the array that are divisible by kk.

  • When k=1k = 1, S={1,2,3,4,5,6}S = \{1, 2, 3,4,5,6\} meaning a1+a2+a3+a4+a5+a6=242a_1+a_2+a_3+a_4+a_5+a_6=242 must be divisible by 11.
  • When k=2k = 2, S={2,4,6}S = \{2,4,6\} meaning a2+a4+a6=92a_2+a_4+a_6=92 must be divisible by 22.
  • When k=3k = 3, S={3,6}S = \{3,6\} meaning a3+a6=69a_3+a_6=69 must divisible by 33.
  • When k=4k = 4, S={4}S = \{4\} meaning a4=32a_4=32 must divisible by 44.
  • When k=5k = 5, S={5}S = \{5\} meaning a5=125a_5=125 must divisible by 55.
  • When k=6k = 6, S={6}S = \{6\} meaning a6=54a_6=54 must divisible by 66.

The array a=[10,6,15,32,125,54]a = [10, 6, 15, 32, 125, 54] satisfies all of the above conditions. Hence, aa is a valid array.

Samples

3
3
6
7
4 22 18
10 6 15 32 125 54
23 18 27 36 5 66 7

在线编程 IDE

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