Codeforces Round 873 (Div. 2)
A
Divisible Array
Codeforces
800
原题
←B →
翻译中…

You are given a positive integer $n$. Please find an array $a_1, a_2, \ldots, a_n$ that is perfect.

翻译中…

A perfect array $a_1, a_2, \ldots, a_n$ satisfies the following criteria:

翻译中…
  • $1 \le a_i \le 1000$ for all $1 \le i \le n$.
  • $a_i$ is divisible by $i$ for all $1 \le i \le n$.
  • $a_1 + a_2 + \ldots + a_n$ is divisible by $n$.
翻译中…

Input

翻译中…

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

翻译中…

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

翻译中…

Output

翻译中…

For each test case, output an array $a_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:

翻译中…
  • $a_1 = 1$ is divisible by $1$.
  • $a_2 = 2$ is divisible by $2$.
  • $a_3 = 3$ is divisible by $3$.
  • $a_1 + a_2 + a_3 = 1 + 2 + 3 = 6$ is divisible by $3$.
翻译中…

In the fifth test case:

翻译中…
  • $a_1 = 3$ is divisible by $1$.
  • $a_2 = 4$ is divisible by $2$.
  • $a_3 = 9$ is divisible by $3$.
  • $a_4 = 4$ is divisible by $4$.
  • $a_5 = 5$ is divisible by $5$.
  • $a_1 + a_2 + a_3 + a_4 + a_5 = 3 + 4 + 9 + 4 + 5 = 25$ is divisible by $5$.
翻译中…

样例

Input #1
7
1
2
3
4
5
6
7
Output #1
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
InputCopy OutputCopy
题目信息
题号
1828A
时间限制
1 s
内存限制
256 MB
标签
构造
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。