malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   long long n, m;   vector<pair<long long, long long> > a;   vector<pair<long long, long long> > fact(2, {1, 0});   long long pow2(long long i, long long m) {     long long r = 1, a = 2, b = i;     while (b != 0) {       if (b % 2 == 1) {         r = (r * a) % m;         b--;       } else {         a = (a * a) % m;         b /= 2;       }     }     return r;   }   bool fun(pair<long long, long long> x, pair<long long, long long> y) {     if (x.first == y.first) {       return x.second < y.second;     }     return x.first < y.first;   }   int main() {     cin >> n;     long long tmp;     for (int i = 0; i < n; i++) {       cin >> tmp;       a.push_back({tmp, i});     }     for (int i = 0; i < n; i++) {       cin >> tmp;       a.push_back({tmp, i});     }     sort(a.begin(), a.end(), fun);     cin >> m;     for (int i = 2; i <= 2 * n + 3; i++) {       int r = i, ct = 0;       while (r % 2 == 0) {         r /= 2;         ct++;       }       pair<long long, long long> p = fact[i - 1];       fact.push_back({(r * p.first) % m, p.second + ct});     }     long long ans = 1;     long long curr = 1, ct = 0;     for (int i = 1; i < a.size(); i++) {       if (a[i].first == a[i - 1].first) {         curr++;         if (a[i].second == a[i - 1].second) {           ct++;         }       } else {         ans = (ans * fact[curr].first) % m;         ans = (ans * pow2(fact[curr].second - ct, m)) % m;         curr = 1;         ct = 0;       }     }     ans = (ans * fact[curr].first) % m;     ans = (ans * pow2(fact[curr].second - ct, m)) % m;     curr = 1;     ct = 0;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     char s[105];     cin >> n;     cin >> s;     vector<int> v;     v.clear();     int cnt = 0;     for (int i = 0; i < n; i++) {       if (s[i] ==  B ) {         ++cnt;       } else {         if (cnt != 0) {           v.push_back(cnt);           cnt = 0;         }       }     }     if (cnt != 0) {       v.push_back(cnt);       cnt = 0;     }     cout << v.size() << endl;     for (int i = 0; i < v.size(); i++) cout << v[i] <<    ;     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1;   const long long MOD = 1;   long long _gcd(long long a, long long b) {     if (b == 0) return a;     return _gcd(b, a % b);   }   long long gcd(long long a, long long b) {     a = abs(a), b = abs(b);     if (a < b) swap(a, b);     return _gcd(a, b);   }   long long qpow(long long a, long long n) {     long long rt = 1;     while (n) {       if (n & 1) rt = (rt * a) % MOD;       a = a * a % MOD;       n >>= 1;     }     return rt;   }   long long factor[MAXN];   long long inv[MAXN];   void cal_factor() {     factor[0] = 1;     for (int u = 1; u < MAXN; u++) {       factor[u] = (factor[u - 1] * u) % MOD;     }   }   void cal_factor_inv() {     inv[0] = 1;     inv[MAXN - 1] = qpow(factor[MAXN - 1], MOD - 2);     for (int u = MAXN - 2; u >= 1; u--) {       inv[u] = inv[u + 1] * (u + 1) % MOD;     }   }   void init_factor() {     cal_factor();     cal_factor_inv();   }   long long C(long long n, long long k) {     if (n < k) return 0;     return factor[n] * qpow(factor[n - k], MOD - 2) % MOD *            qpow(factor[k], MOD - 2) % MOD;   }   void solve() {     int n;     cin >> n;     int mx = 0;     int g = -1;     for (int u = 0; u < n; u++) {       int t;       cin >> t;       if (g == -1)         g = t;       else         g = gcd(g, t);       mx = max(t, mx);     }     if ((mx / g - n) % 2) {       cout <<  Alice n ;     } else {       cout <<  Bob n ;     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     solve();   }
#include <bits/stdc++.h>   using namespace std;   const int M = (int)1e9 + 7;   const int N = (int)2e5 + 5;   struct trio {     long long a;     long long b;     long long c;   };   trio dp[2][N];   long long ps[N];   int main() {     cout.precision(15);     cout.setf(ios::fixed);     int n, k;     int i;     cin >> n >> k;     vector<int> v(n);     for (i = 0; i < n; i++) {       cin >> v[i];       if (i == 0)         ps[i] = v[i];       else         ps[i] = ps[i - 1] + v[i];     }     long long ma = 0, p1, p2;     for (i = k - 1; i < n; i++) {       dp[0][i].a = ps[i] - (i >= k ? ps[i - k] : 0);       dp[0][i].b = i;       if (i >= k)         if (dp[0][i - 1].a >= dp[0][i].a) {           dp[0][i].a = dp[0][i - 1].a;           dp[0][i].b = dp[0][i - 1].b;         }       if (i >= (2 * k - 1)) {         dp[1][i].a = dp[0][i - k].a + ps[i] - (i >= k ? ps[i - k] : 0);         dp[1][i].b = dp[0][i - k].b;       }       if (dp[1][i].a > ma) {         ma = dp[1][i].a;         p1 = dp[1][i].b;         p2 = i;       }     }     cout << p1 + 2 - k <<     << p2 + 2 - k <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k, t, s;     cin >> n >> k >> t;     s = n * k * t / 100;     for (int i = 0; i < n; i++) {       if (s >= k) {         cout << k <<    ;         s -= k;       } else if (s > 0) {         cout << s <<    ;         s = 0;       } else         cout <<  0  ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 5e5 + 100;   int a[maxn];   map<pair<int, int>, bool> mp;   int main() {     ios::sync_with_stdio(false);     int N;     cin >> N;     int M;     cin >> M;     for (int i = 1; i <= N; i++) cin >> a[i];     for (int i = 1; i <= M; i++) {       int x;       int y;       cin >> x >> y;       mp[pair<int, int>(x, y)] = 1;     }     int pos = N;     for (int i = N - 1; i >= 1; i--) {       if (mp[pair<int, int>(a[i], a[pos])] == true) {         int j;         for (j = i; j < pos; j++) {           if (mp[pair<int, int>(a[j], a[j + 1])])             swap(a[j], a[j + 1]);           else             break;         }         if (j == pos) pos -= 1;       }     }     cout << N - pos;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   struct SquareMatrix {     SquareMatrix(int _n) : n(_n) { data.assign(_n, vector<long long>(_n, 0)); }     vector<long long> &operator[](int i) { return data[i]; }     const vector<long long> &operator[](int i) const { return data[i]; }     SquareMatrix operator*(const SquareMatrix &other) const {       assert(n == other.n);       SquareMatrix ret(n);       for (int i = 0; i < n; ++i) {         for (int j = 0; j < n; ++j) {           for (int k = 0; k < n; ++k) {             ret[i][j] = (ret[i][j] + data[i][k] * other[k][j]) % mod;           }         }       }       return ret;     }     vector<vector<long long>> data;     int n;   };   SquareMatrix quickpower(SquareMatrix m, long long p) {     int n = m.n;     SquareMatrix ret(n);     for (int i = 0; i < n; ++i) ret[i][i] = 1;     while (p) {       if (p & 1) {         ret = ret * m;       }       m = m * m;       p >>= 1;     }     return ret;   }   int fun(int x) {     int res = 0;     while (x) {       res += x % 2;       x /= 2;     }     return res;   }   int main() {     long long n, k, m;     scanf( %lld %lld %lld , &n, &k, &m);     long long num = 1 << m;     SquareMatrix M(num * (k + 1));     for (int i = 0; i < num * (k + 1); i++) {       int x = i % (k + 1);       int y = i / (k + 1);       int x1 = x;       int y1 = (y * 2) % num;       int x2 = x + 1;       int y2 = (y * 2) % num + 1;       M[i][y1 * (k + 1) + x1] += 1;       if (x2 <= k) M[i][y2 * (k + 1) + x2] += fun(y) + 1ll;     }     M = quickpower(M, n);     long long ans = 0;     for (int i = 0; i < num; i++) ans = (ans + M[0][i * (k + 1) + k]) % mod;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX = 1e5 + 9;   const int MAX1 = 1e6 + 9;   const double pi = acos(-1);   const long long int inf = 1e9;   const long long mod = 1e9 + 7;   bool prime[MAX];   int pfactors[MAX];   long long int fact[MAX];   long long int ifact[MAX];   long long int mexp(long long int a, long long int b) {     long long int res = 1;     while (b > 0) {       if (b % 2) {         res = (res * a);       }       a = (a * a);       b = b / 2;     }     return res;   }   vector<int> totient() {     long long tt[MAX];     for (int i = 1; i < MAX; i++) tt[i] = i;     for (int i = 2; i < MAX; i++) {       if (tt[i] == i) {         for (int j = i; j < MAX; j += i) {           tt[j] /= i;           tt[j] *= i - 1;         }       }     }     vector<int> v;     for (int i = 1; i < MAX; i++) v.push_back(tt[i]);     return v;   }   vector<int> seive() {     for (int i = 2; i < MAX; i++) prime[i] = false;     int k = 0;     vector<int> p;     for (int i = 2; i < MAX; i++) {       if (!prime[i]) {         for (int j = 2 * i; j < MAX; j += i) prime[j] = true;       }     }     for (int i = 2; i < MAX; i++) {       if (!prime[i]) p.push_back(i);     }     return p;   }   string s;   map<int, int> mp;   int n;   long long int dp[100][100];   int f[MAX];   int ans[MAX];   void dfs(int cur, int a, int b, long long int x) {     if (a < 0 || b < 0) return;     if (x > dp[a][b])       dp[a][b] = x;     else       return;     if (cur == 2 * n) {       for (int i = 0; i < 2 * n; i++) {         ans[i] = f[i];       }       return;     }     long long int c = 1, d = 1;     for (int i = 0; i < a - 1; i++) c = c * 10;     for (int i = 0; i < b - 1; i++) d = d * 10;     f[cur] = 0;     dfs(cur + 1, a - 1, b, x + c * (s[cur] -  0 ));     f[cur] = 1;     dfs(cur + 1, a, b - 1, x + d * (s[cur] -  0 ));   }   int main() {     cin >> n;     cin >> s;     for (int i = 0; i <= 2 * n; i++) {       for (int j = 0; j <= 2 * n; j++) dp[i][j] = -1;     }     for (int i = 0; i <= 2 * n; i++) {       f[i] = -1;       ans[i] = -1;     }     dfs(0, n, n, 0);     for (int i = 0; i < 2 * n; i++) {       if (ans[i] == 0)         cout <<  H ;       else if (ans[i] == 1)         cout <<  M ;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s, t;     while (cin >> s >> t) {       int n = s.size();       string res;       for (int i = n - 1; i >= 0; --i) {         char& c = s[i];         ++c;         int x = 0;         if (c >  z ) {           c =  a ;           x = 1;         }         if (!x and s < t) {           res = s;           break;         }       }       cout << (res.empty() ?  No such string  : res) << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   const int M = 210000;   struct Node {     long long si, fi, ti;   } node[M];   int n, m;   long long get_num(long long x, long long y, long long z, int dir) {     long long sum = 0;     if (dir == 1) {       if (x <= y) {         sum += y - x;         if (y <= z) {           sum += z - y;         } else {           sum += (m - 1 - y) * 2 + y - z;         }       } else {         sum += (m - 1 - x) * 2 + x - y;         if (y >= z)           sum += y - z;         else           sum += 2 * y + z - y;       }     } else {       if (x >= y) {         sum += x - y;         if (y >= z)           sum += y - z;         else           sum += 2 * y + z - y;       } else {         sum += 2 * x + y - x;         if (y <= z)           sum += z - y;         else           sum += (m - 1 - y) * 2 + y - z;       }     }     return sum;   }   int main() {     while (scanf( %d%d , &n, &m) == 2) {       for (int i = 1; i <= n; i++) {         scanf( %lld%lld%lld , &node[i].si, &node[i].fi, &node[i].ti);         node[i].si--;         node[i].fi--;       }       for (int i = 1; i <= n; i++) {         if (node[i].si == node[i].fi) {           printf( %lld n , node[i].ti);           continue;         }         if ((node[i].ti / (m - 1)) % 2 == 0) {           long long cur = node[i].ti % (m - 1);           printf( %lld n , get_num(cur, node[i].si, node[i].fi, 1) + node[i].ti);         } else {           long long cur = m - 1 - node[i].ti % (m - 1);           printf( %lld n , get_num(cur, node[i].si, node[i].fi, -1) + node[i].ti);         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int i, j, n, tmp;     string s;     char c;     scanf( %d , &n);     c =  b ;     s =  a ;     for (i = 1000; i >= 2; i--) {       tmp = i * (i - 1) / 2;       while (n >= tmp) {         n -= tmp;         for (j = 0; j < i; j++) s.push_back(c);         c++;       }     }     printf( %s n , s.c_str());     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long i, n;   int main() {     scanf( %ld , &n);     if (n % 2 != 0) {       for (i = 0; i < n - 1; i++) printf( %ld  , i);       printf( %ld n , n - 1);       for (i = 1; i < n; i++) printf( %ld  , i);       printf( 0 n );       printf( %ld , 1 % n);       for (i = 1; i < n; i++) printf(  %ld , (2 * i + 1) % n);       printf(  n );     } else       printf( -1 n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxN = 100 + 100;   int a1, a2, b1, b2;   int main() {     cin >> a1 >> a2 >> b1 >> b2;     if ((b2 >= a1 - 1 && b2 <= 2 * (a1 + 1)) ||         (b1 >= a2 - 1 && b1 <= 2 * (a2 + 1)))       cout <<  YES  << endl;     else       cout <<  NO  << endl;     return 0;   }
#include <bits/stdc++.h>      using namespace std;   typedef long long ll;   typedef pair<int,int> PII;   #define x first    #define y second   typedef long long ll;   const int N=2e5+10;   const ll mod=1e9+7;   int n,m,k,x;   int w[110],ord[110];   bool st[110];   void solve()   {    int s=0,sum=0;    cin>>n>>x;    for(int i=1;i<=n;i++)    {     cin>>w[i];     s+=w[i];    }    if(s==x)    {     puts( NO );     return ;    }    sort(w+1,w+1+n);    for(int i=1;i<=n;i++)    {     if(sum+w[i]==x)     swap(w[i],w[i+1]);     sum+=w[i];    }    puts( YES );    for(int i=1;i<=n;i++)    {     cout<<w[i]<<   ;    }    cout<<endl;   }   int main()   {    int t;    cin>>t;    while(t--)    {     solve();    }    //system( pause );    return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[300005], b[300005], f[300005], ori[300005];   queue<int> q;   int main() {     int n, i, j, k, u, v, up = n;     scanf( %d , &n);     for (i = 1; i <= n; i++) {       scanf( %d , &a[i]);     }     for (i = 1; i <= n; i++) {       scanf( %d , &b[i]);     }     q.push(n);     f[n] = n;     while (!q.empty()) {       u = q.front();       q.pop();       for (i = u - a[u]; i <= min(u, up); i++) {         v = i + b[i];         if (f[v] != 0) continue;         f[v] = u;         ori[v] = i;         q.push(v);       }       up = min(u - a[u], up);     }     if (f[0] == 0) {       printf( -1 );       return 0;     }     vector<int> ans;     for (i = 0; i < n; i = f[i]) ans.push_back(i);     printf( %d n , ans.size());     for (i = ans.size() - 1; i >= 0; i--) printf( %d  , ori[ans[i]]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main(int argc, char *argv[]) {     vector<string> a;     int n;     cin >> n;     a.resize(n);     for (int i = 0; i < n; ++i) cin >> a[i];     for (int i = n - 2; i >= 0; --i) {       const char *x = a[i].c_str(), *y = a[i + 1].c_str();       int j = 1;       while (x[j] && x[j] == y[j]) ++j;       if (x[j] > y[j]) {         a[i].resize(j);       }     }     for (string s : a) cout << s <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   static const double EPS = 1e-10;   template <typename T, typename S>   vector<T>& operator<<(vector<T>& a, S b) {     a.push_back(b);     return a;   }   template <typename T>   void operator>>(vector<T>& a, int b) {     while (b--)       if (!a.empty()) a.pop_back();   }   bool isprime(int n) {     if (n < 2) return false;     for (int i = 2; i * i <= n; i++)       if (n % i == 0) return false;     return true;   }   long long b_pow(long long x, long long n) {     return n ? b_pow(x * x, n / 2) * (n % 2 ? x : 1) : 1ll;   }   string itos(int n) {     stringstream ss;     ss << n;     return ss.str();   }   vector<vector<int> > DBG;   vector<set<int> > SET;   int where[(200010)];   int idx[(200010)];   int box_size[(200010)];   map<int, pair<int, int> > reg;   int main() {     ios_base::sync_with_stdio(false);     int n, m, h;     cin >> h >> m >> n;     for (int i = 0; i < h; i++) where[i] = -1;     for (int i = 0; i < h; i++) {       if (where[i] == -1) {         DBG.push_back(vector<int>(0));         int x = i;         int size = 0;         SET.push_back(set<int>());         while (where[x] == -1) {           size++;           where[x] = SET.size() - 1;           idx[x] = size;           SET.back().insert(size);           DBG.back().push_back(x);           x = (x + m) % h;         }         box_size[SET.size() - 1] = size;       }     }     long long ans = 0;     for (int i = 0; i < n; i++) {       char c;       int a, b;       cin >> c;       if (c ==  + ) {         cin >> a >> b;         int w = where[b];         int p = idx[b];         set<int>& my = SET[w];         set<int>::iterator it = my.lower_bound(p);         if (it == my.end()) {           ans += box_size[w] - p;           set<int>::iterator it2 = my.lower_bound(0);           ans += *(it2);           reg[a] = make_pair(w, *it2);           my.erase(*it2);         } else {           ans += (*it) - p;           reg[a] = make_pair(w, *it);           my.erase(*it);         }       } else {         cin >> a;         int w = reg[a].first;         int p = reg[a].second;         SET[w].insert(p);       }     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 2;   const int M = 2e6;   const int V = 500;   const int mod = 0;   const int inf = 2e9 + 3;   const long long INF = 1e16;   int dp[V + 20][N], n, q, a[N];   int calc(int p, int k) {     int ans = 0;     while (p <= n) {       ans++;       p = p + a[p] + k;     }     return ans;   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) scanf( %d , &a[i]);     for (int j = 1; j <= V; ++j)       for (int i = n; i >= 1; --i) dp[j][i] = 1 + dp[j][i + a[i] + j];     scanf( %d , &q);     while (q--) {       int p, k;       scanf( %d %d , &p, &k);       if (k <= V)         printf( %d n , dp[k][p]);       else         printf( %d n , calc(p, k));     }   }
#include <bits/stdc++.h>   char ansStr[1000000];   int nextInt() {     char ch;     int s, x;     do {       ch = getchar();     } while (ch <= 32);     if (ch ==  - ) {       s = -1;       ch = getchar();     } else       s = 1;     x = 0;     while (ch >=  0  && ch <=  9 ) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     return s * x;   }   int main(void) {     int i, j;     int n, ans, q, cnt;     n = nextInt();     ans = 0;     for (i = 0; i < n * n; i++) {       int a;       a = nextInt();       if (i % (n + 1) == 0) ans ^= a;     }     q = nextInt();     cnt = 0;     while (q--) {       int t;       t = nextInt();       if (t == 3)         ansStr[cnt++] =  0  + ans;       else {         nextInt();         ans ^= 1;       }     }     puts(ansStr);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<int> H;   vector<int> L;   int a[200001];   bool vis[200001];   int main() {     int n;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);     }     bool T = 0;     for (int i = 1; i <= n;) {       bool faH = 0, faL = 0;       int tailH = H.size() - 1, tailL = L.size() - 1;       if (H.size() == 0)         faH = 1;       else if (H[tailH] < a[i])         faH = 1;       if (L.size() == 0)         faL = 1;       else if (L[tailL] > a[i])         faL = 1;       if (faH == 0 && faL == 0) {         T = 1;         break;       }       if (faH == 0 && faL == 1) {         L.push_back(a[i]);         vis[i] = 1;         i++;       }       if (faH == 1 && faL == 0) {         H.push_back(a[i]);         vis[i] = 0;         i++;       }       if (faH == 1 && faL == 1) {         if (a[i] < a[i + 1]) {           H.push_back(a[i]);           vis[i] = 0;           i++;         } else if (a[i] > a[i + 1]) {           L.push_back(a[i]);           vis[i] = 1;           i++;         } else {           H.push_back(a[i]);           L.push_back(a[i + 1]);           vis[i] = 0;           vis[i + 1] = 1;           i += 2;         }       }     }     if (T)       puts( NO );     else {       puts( YES );       for (int i = 1; i <= n; i++) {         printf( %d  , vis[i]);       }     }   }
#include <bits/stdc++.h>   int main() {     int a[105][4], n, ans, flag, i, j;     scanf( %d , &n);     for (i = 0; i < n; i++)       scanf( %d%d%d%d , &a[i][0], &a[i][1], &a[i][2], &a[i][3]);     ans = -1;     for (i = 0; i < n; i++) {       flag = 0;       for (j = 0; j < n; j++)         if (a[i][0] < a[j][0] && a[i][1] < a[j][1] && a[i][2] < a[j][2]) {           flag = 1;           break;         }       if (flag == 0 && (ans == -1 || a[ans][3] > a[i][3])) ans = i;     }     printf( %d n , ans + 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     long long T = 1;     while (T--) {       long long n;       cin >> n;       vector<pair<long long, long long> > q1, q2, q3, q4;       for (long long i = 0; i < n; i++) {         long long x, y;         cin >> x >> y;         if (x >= 0 && y >= 0)           q1.push_back({x, y});         else if (x >= 0 && y <= 0)           q4.push_back({x, -y});         else if (x <= 0 && y >= 0)           q2.push_back({-x, y});         else           q3.push_back({-x, -y});       }       sort((q1).begin(), (q1).end());       sort((q2).begin(), (q2).end());       sort((q3).begin(), (q3).end());       sort((q4).begin(), (q4).end());       vector<string> ans;       for (auto it = (q1).begin(); it != (q1).end(); it++) {         long long x = it->first, y = it->second;         string a =   , b =   , c =   , d =   ;         a =  1   + to_string(x) +   R ;         b =  1   + to_string(x) +   L ;         c =  1   + to_string(y) +   U ;         d =  1   + to_string(y) +   D ;         if (x) ans.push_back(a);         if (y) ans.push_back(c);         ans.push_back( 2 );         if (y) ans.push_back(d);         if (x) ans.push_back(b);         ans.push_back( 3 );       }       for (auto it = (q2).begin(); it != (q2).end(); it++) {         long long x = it->first, y = it->second;         string a =   , b =   , c =   , d =   ;         a =  1   + to_string(x) +   L ;         b =  1   + to_string(x) +   R ;         c =  1   + to_string(y) +   U ;         d =  1   + to_string(y) +   D ;         if (x) ans.push_back(a);         if (y) ans.push_back(c);         ans.push_back( 2 );         if (y) ans.push_back(d);         if (x) ans.push_back(b);         ans.push_back( 3 );       }       for (auto it = (q3).begin(); it != (q3).end(); it++) {         long long x = it->first, y = it->second;         string a =   , b =   , c =   , d =   ;         a =  1   + to_string(x) +   L ;         b =  1   + to_string(x) +   R ;         c =  1   + to_string(y) +   D ;         d =  1   + to_string(y) +   U ;         if (x) ans.push_back(a);         if (y) ans.push_back(c);         ans.push_back( 2 );         if (y) ans.push_back(d);         if (x) ans.push_back(b);         ans.push_back( 3 );       }       for (auto it = (q4).begin(); it != (q4).end(); it++) {         long long x = it->first, y = it->second;         string a =   , b =   , c =   , d =   ;         a =  1   + to_string(x) +   R ;         b =  1   + to_string(x) +   L ;         c =  1   + to_string(y) +   D ;         d =  1   + to_string(y) +   U ;         if (x) ans.push_back(a);         if (y) ans.push_back(c);         ans.push_back( 2 );         if (y) ans.push_back(d);         if (x) ans.push_back(b);         ans.push_back( 3 );       }       cout << ans.size() <<   n ;       for (auto it = (ans).begin(); it != (ans).end(); it++) cout << *it <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, x, y;     cin >> n >> x >> y;     if ((x == n / 2 || x == n / 2 + 1) and (y == n / 2 || y == n / 2 + 1))       cout <<  NO  << endl;     else       cout <<  YES  << endl;     return 0;   }