201182: [AtCoder]ARC118 C - Coprime Set

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

Description

Score : $500$ points

Problem Statement

Given is a positive integer $N$. Print an integer sequence $A = (A_1, A_2, \ldots, A_N)$ satisfying all of the following:

  • $1\leq A_i\leq 10000$;
  • $A_i\neq A_j$ and $\gcd(A_i, A_j) > 1$ for $i\neq j$;
  • $\gcd(A_1, A_2, \ldots, A_N) = 1$.

We can prove that, under the Constraints of this problem, such an integer sequence always exists.

Constraints

  • $3\leq N\leq 2500$

Input

Input is given from Standard Input in the following format:

$N$

Output

Print the elements in your integer sequence $A$ satisfying the conditions in one line, with spaces in between.

$A_1$ $A_2$ $\ldots$ $A_N$

If multiple sequences satisfy the conditions, any of them will be accepted.


Sample Input 1

4

Sample Output 1

84 60 105 70

All of the conditions are satisfied, since we have:

  • $\gcd(84,60) = 12$
  • $\gcd(84,105) = 21$
  • $\gcd(84,70) = 14$
  • $\gcd(60,105) = 15$
  • $\gcd(60,70) = 10$
  • $\gcd(105,70) = 35$
  • $\gcd(84,60,105,70) = 1$

Input

题意翻译

输入n,输出n个数,构造数组A1,A2,...,An 满足以下条件: 1:对于任意i(1<=i<=n) 1<=Ai<=10000 2.任意两数的最大公约数**大于**1 3.所有数的最大公约数**等于**1

加入题单

算法标签: