Coprime Set

AtCoder
IDarc118_c
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
4
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$
API Response (JSON)
{
  "problem": {
    "name": "Coprime Set",
    "description": {
      "content": "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\\",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc118_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given is a positive integer $N$. Print an integer sequence $A = (A_1, A_2, \\ldots, A_N)$ satisfying all of the following:\n\n*   $1\\leq A_i\\leq 10000$;\n*   $A_i\\neq A_j$ and $\\gcd(A_i, A_j) > 1$ for $i\\...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments