跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1392. Optimal Number Permutation

    ID: 1398 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>构造算法思想提高难度共享题库Codeforces英文题面题目来源题面语言

Optimal Number Permutation

题目描述

D. Optimal Number Permutation
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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.

Examples
Input
2
Output
1 1 2 2
Input
1
Output
1 1

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 895 题。保留原作者与原赛事署名。