#include #include #include #include #include #include #include #include #include #include #include #ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG #endif using namespace std; #define pb push_back #define all(v) v.begin(), v.end() #define sz(v) (int)v.size() //--------------型系---------------- using ll = long long; using ull = unsigned long long; //--------------配列系-------------- using vl = vector; using vvl = vector; using vvvl = vector; using vs = vector; using vvs = vector; using vb = vector; using vvb = vector; using vvvb = vector; using vld = vector; using vvld = vector; using P = pair;using vp = vector

; using mpll = map; //--------------出力---------------- #define YES cout<<"Yes"<= 0; --i) #define nfor(i,s,n) for(ll i=s;i=n;i--)//s-1スタートでnまで落ちる //--------------平均average 分散variance 標準偏差std_dev-------------------- double average(int n, vector& s) { double sum = 0; rep(i, n) { sum += s[i]; } return static_cast(sum) / n; } double variance(int n, vector& s) { double avg = average(n, s); double var = 0.0; rep (i,n) { var += pow(s[i]-avg,2); } return var / n; } double std_dev(int n, vector& s) { double sum = 0; rep(i, n) { sum += s[i]; } double average = static_cast(sum) / n; double variance = 0.0; rep (i,n) { variance += pow(s[i]-average,2); } variance /= n; return sqrt(variance); } //--------------------整数問題系-------------------- ll base(ll a, ll x) {//aをx進数に変換 ll result = 0,power_of_10 = 1; while (a > 0) {result +=(a % x)* power_of_10; a /= x; power_of_10 *= 10;} return result; } ll gcd(ll a, ll b) {//最大公約数,ユークリッドの互除法 if (b == 0) return a; return gcd(b, a % b); } ll lcm(ll a, ll b) {//最小公倍数 return a / gcd(a, b) * b; } ll nc2(ll x) { return x * (x - 1) / 2; }//Combination ll nc3(ll x) { return x * (x - 1) * (x - 2) / 6; }//Combination //---------------------------------------- #define uni(v) sort(all(v));v.erase( unique(all(v)), v.end() );//配列の重複を削除する #define vc_rotate(v) rotate(v.begin(),v.begin()+1,v.end());//先頭の要素を末尾に回す #define vc_reverse(v) reverse(v.begin(),v.end());//配列を反転する #define rsort(v) sort(v.rbegin(),v.rend());//配列を降順にソートする void solve() { } int main() {cin.tie(nullptr);ios::sync_with_stdio(false);cout << fixed << setprecision(10); ll n;cin >> n; vl a(n);rep(i,n) a[i]=i+1; do{ mpll mp; rep(i,n-1) mp[a[i]+a[i+1]]++; mp[a[n-1]+a[0]]++; if (mp.size()==n){ YES; rep(i,n) cout << a[i] << " "; cout << endl; return 0; } } while(next_permutation(all(a))); NO; }