4915: Optimal Number Permutation

内存限制:256 MB 时间限制:2 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:5 通过:3

题目描述

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


数组a包含从1到n的所有整数两次。你可以任意排列a中的任何数字。
让数字i位于置换数组a中的位置xi,yi(xi<yi)。让我们定义值di=yi-xi−数字i的位置之间的距离。置换数组a的数字以使总和的值最小化 s = SUM[(n-i)*abs(di+i-n)] (1 <= i <= n)
输入:
包含一个整数n(1<=n<=5e5)
输出:
打印2n个整数–使和s的值最小化的排列数组a。

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

输入格式

输出格式

输入样例 复制


输出样例 复制


数据范围与提示