CF1608A.Find Array

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Given nn, find any array a1,a2,…,ana_1, a_2, \ldots, a_n of integers such that all of the following conditions hold:

  • 1≤ai≤1091 \le a_i \le 10^9 for every ii from 11 to nn.

  • a1<a2<…<ana_1 \lt a_2 \lt \ldots \lt a_n

  • For every ii from 22 to nn, aia_i isn't divisible by ai−1a_{i-1}

It can be shown that such an array always exists under the constraints of the problem.

给定 nn,请构造一个由整数构成的数组 a1,a2,…,ana_1, a_2, \ldots, a_n,使得以下所有条件均满足:

  • 对每个 ii(从 11 到 nn),均有 1≤ai≤1091 \le a_i \le 10^9;

  • a1<a2<…<ana_1 \lt a_2 \lt \ldots \lt a_n;

  • 对每个 ii(从 22 到 nn),aia_i 不能被 ai−1a_{i-1} 整除。

在本题约束下,可以证明这样的数组一定存在。

输入格式

The first line contains the number of test cases tt (1≤t≤1001 \le t \le 100). Description of the test cases follows.

The only line of each test case contains a single integer nn (1≤n≤10001 \le n \le 1000).

It is guaranteed that the sum of nn over all test cases does not exceed 10410^4.

第一行包含测试用例的数量 tt(1≤t≤1001 \le t \le 100)。随后是各测试用例的描述。

每个测试用例仅有一行,包含一个整数 nn(1≤n≤10001 \le n \le 1000)。

保证所有测试用例中 nn 的总和不超过 10410^4。

输出格式

For each test case print nn integers a1,a2,…,ana_1, a_2, \ldots, a_n — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.

对于每个测试用例,输出 nn 个整数 a1,a2,…,ana_1, a_2, \ldots, a_n —— 即你找到的数组。如果存在多个满足所有条件的数组,输出其中任意一个即可。

输入输出样例

  • 输入#1

    3
    1
    2
    7

    输出#1

    1
    2 3
    111 1111 11111 111111 1111111 11111111 111111111

说明/提示

In the first test case, array [1][1] satisfies all the conditions.

In the second test case, array [2,3][2, 3] satisfies all the conditions, as 2<32 \lt 3 and 33 is not divisible by 22.

In the third test case, array [111,1111,11111,111111,1111111,11111111,111111111][111, 1111, 11111, 111111, 1111111, 11111111, 111111111] satisfies all the conditions, as it's increasing and aia_i isn't divisible by ai−1a_{i-1} for any ii from 22 to 77.

在第一个测试用例中,数组 [1][1] 满足所有条件。

在第二个测试用例中,数组 [2,3][2, 3] 满足所有条件,因为 2<32 \lt 3 且 33 不能被 22 整除。

在第三个测试用例中,数组 [111,1111,11111,111111,1111111,11111111,111111111][111, 1111, 11111, 111111, 1111111, 11111111, 111111111] 满足所有条件,因为该数组严格递增,且对任意 ii(从 22 到 77),aia_i 均不能被 ai−1a_{i-1} 整除。

输入解题思路,AI测评打分。不知道怎么写?

首页