Preparando MOJI

Optimal Number Permutation

1000ms 262144K

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 .

Input:

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

Output:

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

Sample Input:

2

Sample Output:

1 1 2 2

Sample Input:

1

Sample Output:

1 1

Informação

Codeforces

Provedor Codeforces

Código CF622D

Tags

constructive algorithms

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:03:40

Relacionados

Nada ainda