Subject to the effect
Give you a n
Let you use 1 ~ 2 * n number to fill a 2 * n points ring
Such that any n consecutive positions of maximum minus minimum and not more than 1
analysis
We find the law by blind jb n is even found Wu Jie
And n is an odd we set the first n group position is 0, the group of n is 1
Then fill such
1-0
2-1
3-1
4-0
5-0
6-1
7-1
8-0
Not difficult to see the law
Code
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<ctime>
#include<vector>
#include<set>
#include<map>
#include<stack>
using namespace std;
int a[300100];
int main(){
int n,i,j,k;
scanf("%d",&n);
if(n&1){
puts("YES");
for(i=1;i<=n;i++)
if(i&1)a[i]=2*i-1,a[n+i]=2*i;
else a[i]=2*i,a[n+i]=2*i-1;
for(i=1;i<=2*n;i++)printf("%d ",a[i]);
puts("");
}else puts("NO");
return 0;
}