ℕ Coloring

AtCoder
IDarc115_c
Time2000ms
Memory256MB
Difficulty
Given is an integer $N$. Among the sequences of $N$ positive integers $A_1, A_2, \ldots, A_N$ satisfying the following condition, print one that minimizes the maximum value in the sequence. * If $i$ divides $j$, $A_i \neq A_j$ $(1 \leq i < j \leq N)$. ## Constraints * $1 \leq N \leq 10^5$ ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
4
Output #1
1 2 2 3

This solution satisfies all of the following conditions:

*   $A_1 \neq A_2$
*   $A_1 \neq A_3$
*   $A_1 \neq A_4$
*   $A_2 \neq A_4$

Additionally, there is no sequence satisfying these conditions where the maximum value in the sequence is $2$ or less, so this is a valid solution.
API Response (JSON)
{
  "problem": {
    "name": "ℕ Coloring",
    "description": {
      "content": "Given is an integer $N$. Among the sequences of $N$ positive integers $A_1, A_2, \\ldots, A_N$ satisfying the following condition, print one that minimizes the maximum value in the sequence. *   If $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": "arc115_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given is an integer $N$. Among the sequences of $N$ positive integers $A_1, A_2, \\ldots, A_N$ satisfying the following condition, print one that minimizes the maximum value in the sequence.\n\n*   If $i...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments