310736: CF1878B. Aleksa and Stack

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Aleksa and Stacktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

After the Serbian Informatics Olympiad, Aleksa was very sad, because he didn't win a medal (he didn't know stack), so Vasilije came to give him an easy problem, just to make his day better.

Vasilije gave Aleksa a positive integer $n$ ($n \ge 3$) and asked him to construct a strictly increasing array of size $n$ of positive integers, such that

  • $3\cdot a_{i+2}$ is not divisible by $a_i+a_{i+1}$ for each $i$ ($1\le i \le n-2$).
Note that a strictly increasing array $a$ of size $n$ is an array where $a_i < a_{i+1}$ for each $i$ ($1 \le i \le n-1$).

Since Aleksa thinks he is a bad programmer now, he asked you to help him find such an array.

Input

Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \le t \le 10^4$) — the number of test cases. The description of test cases follows.

The first line of each test case contains a single integer $n$ ($3 \le n \le 2 \cdot 10^5$) — the number of elements in array.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output

For each test case, output $n$ integers $a_1, a_2, a_3, \dots, a_n$ ($1 \le a_i \le 10^9$).

It can be proved that the solution exists for any $n$. If there are multiple solutions, output any of them.

ExampleInput
3
3
6
7
Output
6 8 12
7 11 14 20 22 100
9 15 18 27 36 90 120
Note

In the first test case, $a_1=6$, $a_2=8$, $a_3=12$, so $a_1+a_2=14$ and $3 \cdot a_3=36$, so $3 \cdot a_3$ is not divisible by $a_1+a_2$.

Output

题目大意:
Aleksa在塞尔维亚信息学奥林匹克竞赛中没有赢得奖牌,因为他不了解栈(stack),所以Vasilije给他一个简单的问题来让他的心情好转。问题是给定一个正整数n(n≥3),要求构造一个严格递增的正整数数组a,数组大小为n,满足对于每个i(1≤i≤n-2),3ai+2不是ai+ai+1的倍数。需要帮助Aleksa找到这样的数组。

输入输出数据格式:
输入:
- 第一行包含一个整数t(1≤t≤10^4),表示测试用例的数量。
- 每个测试用例的第一行包含一个整数n(3≤n≤2×10^5),表示数组中元素的数量。
- 保证所有测试用例的n之和不超过2×10^5。

输出:
- 对于每个测试用例,输出n个整数a1, a2, a3, ..., an(1≤ai≤10^9),表示构造的数组。
- 可以证明对于任何n都存在解决方案。如果有多个解决方案,输出其中任意一个。

示例:
输入:
```
3
3
6
7
```
输出:
```
6 8 12
7 11 14 20 22 100
9 15 18 27 36 90 120
```

注意:
在第一个测试用例中,a1=6,a2=8,a3=12,所以a1+a2=14,且3×a3=36,所以3×a3不是a1+a2的倍数。题目大意: Aleksa在塞尔维亚信息学奥林匹克竞赛中没有赢得奖牌,因为他不了解栈(stack),所以Vasilije给他一个简单的问题来让他的心情好转。问题是给定一个正整数n(n≥3),要求构造一个严格递增的正整数数组a,数组大小为n,满足对于每个i(1≤i≤n-2),3ai+2不是ai+ai+1的倍数。需要帮助Aleksa找到这样的数组。 输入输出数据格式: 输入: - 第一行包含一个整数t(1≤t≤10^4),表示测试用例的数量。 - 每个测试用例的第一行包含一个整数n(3≤n≤2×10^5),表示数组中元素的数量。 - 保证所有测试用例的n之和不超过2×10^5。 输出: - 对于每个测试用例,输出n个整数a1, a2, a3, ..., an(1≤ai≤10^9),表示构造的数组。 - 可以证明对于任何n都存在解决方案。如果有多个解决方案,输出其中任意一个。 示例: 输入: ``` 3 3 6 7 ``` 输出: ``` 6 8 12 7 11 14 20 22 100 9 15 18 27 36 90 120 ``` 注意: 在第一个测试用例中,a1=6,a2=8,a3=12,所以a1+a2=14,且3×a3=36,所以3×a3不是a1+a2的倍数。

加入题单

上一题 下一题 算法标签: