問題一覧 > 通常問題

No.1351 Sum of GCD Equals LCM

レベル : / AI推定難易度 : 700 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 119
作問者 : KoD / テスター : maguro blackyuki PCTprobability
お気に入りにしたユーザー ProblemId : 5765 / 自分の提出
問題文最終更新日: 2021-01-16 18:30:23
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
灘中入試コンテストday2 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。