Problem D

Statement
Copy Copied
Description:
You have array a that contains all integers from 1 to n twice. You can arbitrary permute any numbers in a.

Let number i be in positions xi, yi (xi < yi) in the permuted array a. Let's define the value di = yi - xi — the distance between the positions of the number i. Permute the numbers in array a to minimize the value of the sum $$s = \sum_{i=1}^{n}(n-i) \cdot |d_i + i - n|$$.

Input Format:
The only line contains integer n (1 ≤ n ≤ 5·105).

Output Format:
Print 2n integers — the permuted array a that minimizes the value of the sum s.

Note:
None

Submissions

IDLanguageExit CodeTimestampCodeStdoutStderrRetry
4620 cpp 0 2026-02-27T07:20:45.367053Z View View View Retry
4619 go 1 2026-02-27T07:19:37.990783Z View View View Retry
4617 cpp 1 2026-02-27T07:15:57.254492Z View View View Retry

Evaluations

Eval IDRun IDProviderModelLangSuccessTimestampPromptResponseStdoutStderrRetry
1293 20260228-152401 openrouter moonshotai/kimi-k2.5 go true 2026-02-28T17:17:58.130389Z View View View View Retry
481 20260217-144912 openrouter x-ai/grok-4 go false 2026-02-17T22:12:51.34674Z View View View View Retry