#include #define fi first #define se second #define rep(i,s,n) for (int i = (s); i < (n); ++i) #define rrep(i,g,n) for (int i = (n)-1; i >= (g); --i) #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define len(x) (int)(x).size() #define dup(x,y) (((x)+(y)-1)/(y)) #define pb push_back #define eb emplace_back #define Field(T) vector> using namespace std; using ll = long long; using ull = unsigned long long; template using pq = priority_queue,greater>; using P = pair; templatebool chmax(T&a,T b){if(abool chmin(T&a,T b){if(b> n >> k; if (__builtin_popcount(n) == 1) { if (k >= n) { cout << "No" << endl; } else { vector p(n); rep(i,0,n) p[i] = n-i-1; swap(p[n-1], p[n-k-1]); cout << "Yes" << endl; rep(i,0,n) cout << i << " "; cout << endl; rep(i,0,n) cout << p[i] << " "; cout << endl; return 0; } return 0; } int l = 31-__builtin_clz(n); if (k >= (1<<(l+1))) { cout << "No" << endl; return 0; } function)> g = [&](vector p) { int ret = 0; rep(i,0,n) ret |= (i&p[i]); return ret; }; function(int)> f = [&](int x) { int b = 31-__builtin_clz(x); vector ret(1< y = f(x-(1< p = f(n); swap(p[(1<= (1< p(n); // iota(all(p), 0); // do { // int x = 0; // rep(i,0,n) x |= (i&p[i]); // for (auto e : p) cout << e << " "; // cout << "-> " << x << endl; // } while(next_permutation(all(p))); return 0; }