CF1828A.Divisible Array
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given a positive integer n . Please find an array a1,a2,…,an that is perfect.
A perfect array a1,a2,…,an satisfies the following criteria:
- 1≤ai≤1000 for all 1≤i≤n .
- ai is divisible by i for all 1≤i≤n .
- a1+a2+…+an is divisible by n .
输入格式
Each test contains multiple test cases. The first line contains the number of test cases t ( 1≤t≤200 ). The description of the test cases follows.
The only line of each test case contains a single positive integer n ( 1≤n≤200 ) — the length of the array a .
输出格式
For each test case, output an array a1,a2,…,an that is perfect.
We can show that an answer always exists. If there are multiple solutions, print any.
输入输出样例
输入#1
7 1 2 3 4 5 6 7
输出#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
说明/提示
In the third test case:
- a1=1 is divisible by 1 .
- a2=2 is divisible by 2 .
- a3=3 is divisible by 3 .
- a1+a2+a3=1+2+3=6 is divisible by 3 .
In the fifth test case:
- a1=3 is divisible by 1 .
- a2=4 is divisible by 2 .
- a3=9 is divisible by 3 .
- a4=4 is divisible by 4 .
- a5=5 is divisible by 5 .
- a1+a2+a3+a4+a5=3+4+9+4+5=25 is divisible by 5 .