No.1351 Sum of GCD Equals LCM
タグ : / 解いたユーザー数 119
作問者 :
KoD
/ テスター :
maguro
PCTprobability
Problem Statement
Problem idea: blackyuki
blackyuki is a student preparing for entrance exams, and today is the day of the actual exam. He has even prayed for success and is fully prepared.
Now, the arithmetic exam has started, and when he looked at the statement of the first question, it asked him to calculate a least common multiple.
Feeling that this question was too easy, blackyuki decided to write the following problem on his answer sheet and have the grader solve it.
You are given a positive integer $N$. Output a sequence of positive integers $A_1, A_2, \dots, A_N$ satisfying the following conditions.
- The $A_i$ are pairwise distinct.
- $1 \leq A_i \leq 10^{16} \,\, (1 \leq i \leq N)$
- $\gcd (A_1, A_2) + \gcd (A_2, A_3) + \dots + \gcd(A_{N - 1}, A_N) + \gcd(A_N, A_1)$ is equal to the smallest positive integer that is divisible by every one of $A_1, A_2, \dots, A_N$.
The grader is busy, so you have been asked to solve this problem instead.
It is guaranteed that at least one solution satisfying the conditions exists within the constraints. If there are multiple solutions, you may output any of them.
Input
$N$
- $3 \leq N \leq 50$
- All inputs are integers.
Output
Output $N$ integers satisfying the conditions on one line, separated by spaces. Print a newline at the end.
Sample
Sample 1
Input
3
Output
6 2 3
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。