ezraft 与数组AI (CI翻译)
You are given a single integer $n.$ Construct an array of $n$ distinct positive integers $a_1, \ldots, a_n$ such that for all $i \, (1 \le i \le n)$, $a_1 + a_2 + a_3 + \ldots + a_n$ is divisible by $a_i,$ or determine that no such array exists.
你将得到一个整数 $n.$ 请构造一个由 $n$ 个互不相同的正整数 $a_1, \ldots, a_n$ 组成的数组,使得对于所有 $i \, (1 \le i \le n)$,$a_1 + a_2 + a_3 + \ldots + a_n$ 都能被 $a_i$ 整除;如果不存在这样的数组,则确定这一点。AI (CI翻译)
Input
输入格式
AI (CI翻译)Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 50$). The description of the test cases follows.
每个测试包含多组测试数据。第一行包含测试数据组数 $t$($1 \le t \le 50$)。接下来是各组测试数据的描述。AI (CI翻译)
The first and only line of each test case contains a single integer $n \, (1 \le n \le 50).$
每组测试数据的第一行且仅有一行包含一个整数 $n \, (1 \le n \le 50)。$AI (CI翻译)
Output
输出格式
AI (CI翻译)For each test case, if there is no solution, output a single integer $-1$.
对于每组测试数据,如果不存在解,输出一个整数 $-1$。AI (CI翻译)
Otherwise, output $n$ integers $a_1, \ldots, a_n \, (1 \le a_i \le 10^{17})$ — an array satisfying the conditions.
否则,输出 $n$ 个整数 $a_1, \ldots, a_n \, (1 \le a_i \le 10^{17})$,表示一个满足条件的数组。AI (CI翻译)
If there are multiple solutions, print any of them.
如果有多个解,输出任意一个即可。AI (CI翻译)
Note
说明
AI (CI翻译)In the first test case, the condition is clearly satisfied, since $1$ is divisible by itself.
在第一组测试数据中,条件显然满足,因为 $1$ 能被自身整除。AI (CI翻译)
In the second test case, the output is $a = [1,9,2,6].$ We have $a_1 + a_2 + a_3 + a_4 = 18,$ which is divisible by all $a_i.$
在第二组测试数据中,输出为 $a = [1,9,2,6]$。有 $a_1 + a_2 + a_3 + a_4 = 18$,而 $18$ 能被所有 $a_i$ 整除。AI (CI翻译)
样例
3
1
4
5
1
1 9 2 6
12 3 10 20 15
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。