malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   long long m, tot, cnt;   long long geta(long long limit) {     long long res = 1;     while (res * res * res <= limit) res++;     return res - 1;   }   void dfs(long long limit, long long num, long long vol) {     if (limit == 0) {       if (cnt < num) {         cnt = num;         tot = vol;       }       return;     }     long long a = geta(limit);     dfs(limit - a * a * a, num + 1, vol + a * a * a);     if (a > 1) {       dfs(a * a * a - 1 - (a - 1) * (a - 1) * (a - 1), num + 1,           vol + (a - 1) * (a - 1) * (a - 1));     }   }   int main() {     while (scanf( %I64d , &m) != EOF) {       cnt = 0, tot = 0;       dfs(m, 0, 0);       printf( %I64d %I64d n , cnt, tot);     }   }
#include <bits/stdc++.h>   #pragma GCC optimize( O2,unroll-loops )   using namespace std;   const int inf = 1000000010;   const long long INF = 10000000000000010LL;   const int mod = 1000000007;   const int MAXN = 300010, LOG = 20;   int n, m, k, u, v, x, y, t, a, b, ans;   int par[MAXN], h[MAXN], leaf[MAXN];   vector<int> G[MAXN];   void dfs(int node) {     h[node] = h[par[node]] + 1;     leaf[node] = 1;     for (int v : G[node])       if (!h[v]) {         par[v] = node;         dfs(v);         leaf[node] = 0;       }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> m >> k;     while (m--) {       cin >> u >> v;       G[u].push_back(v);       G[v].push_back(u);     }     dfs(1);     for (int v = 1; v <= n; v++)       if (h[v] * k >= n) {         cout <<  PATH   << h[v] <<   n ;         while (v) {           cout << v <<    ;           v = par[v];         }         return 0;       }     cout <<  CYCLES n ;     for (int v = 2; v <= n && k; v++)       if (leaf[v]) {         k--;         int done = 0, x = 0, y = 0;         for (int u : G[v])           if (u != par[v]) {             if ((h[v] - h[u] + 1) % 3) {               cout << h[v] - h[u] + 1 <<   n ;               x = v;               while (1) {                 cout << x <<    ;                 if (x == u) break;                 x = par[x];               }               cout <<   n ;               done = 1;               break;             }             if (x)               y = u;             else               x = u;           }         if (done) continue;         assert(x && y);         cerr <<  {               <<  x               <<  ,                <<  y               <<  } = {  << (x) <<  ,   << (y) <<  }  << endl;         if (h[x] < h[y]) swap(x, y);         cout << h[x] - h[y] + 2 <<   n ;         while (1) {           cout << x <<    ;           if (x == y) break;           x = par[x];         }         cout << v <<   n ;       }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int oo = 1 << 30;   int ds[500500], par[500500], parEdge[500500], depth[500500], anc[500500],       ans[500500];   vector<pair<int, int>> a[500500];   int get(int ds[], int x) { return x == ds[x] ? x : ds[x] = get(ds, ds[x]); }   void dfs(int x) {     for (auto [y, id] : a[x])       if (y != par[x]) {         par[y] = x;         parEdge[y] = id;         depth[y] = depth[x] + 1;         dfs(y);       }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     int n, k, m;     cin >> n >> k >> m;     for (int i = 1; i <= n; i++) ds[i] = i;     for (int i = 0; i < k; i++) {       int x, y;       cin >> x >> y;       a[x].push_back({y, i});       a[y].push_back({x, i});       ds[get(ds, x)] = get(ds, y);       ans[i] = oo;     }     vector<tuple<int, int, int>> unusedEdges;     for (int i = 0; i < m; i++) {       int x, y, z;       cin >> x >> y >> z;       int dx = get(ds, x), dy = get(ds, y);       if (dx == dy)         unusedEdges.push_back({x, y, z});       else {         ds[dx] = dy;         a[x].push_back({y, -1});         a[y].push_back({x, -1});       }     }     dfs(1);     for (int i = 1; i <= n; i++) anc[i] = i;     for (auto [x, y, z] : unusedEdges)       while (1) {         x = get(anc, x);         y = get(anc, y);         if (x == y) break;         int dx = depth[x], dy = depth[y];         if (dx >= dy) {           if (parEdge[x] >= 0 && ans[parEdge[x]] == oo) ans[parEdge[x]] = z;           x = anc[x] = par[x];         }         if (dy >= dx) {           if (parEdge[y] >= 0 && ans[parEdge[y]] == oo) ans[parEdge[y]] = z;           y = anc[y] = par[y];         }       }     long long sum = 0;     for (int i = 0; i < k; i++)       if (ans[i] < oo)         sum += ans[i];       else {         cout << -1 << endl;         return 0;       }     cout << sum << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 112345;   vector<int> v[N];   int read() {     int x;     scanf( %d , &x);     return x;   }   int cnt[N];   bool used[N];   bool t[N];   bool never[N];   int main() {     int n, m, i, j, x, y;     n = read();     for (i = 2; i <= n; i++) {       x = read();       y = read();       v[x].push_back(y);       cnt[x]++;       cnt[y]++;       v[y].push_back(x);     }     queue<int> q;     for (int i = 1; i <= n; i++) {       if (cnt[i] == 1) {         q.push(i);         used[i] = 1;       }     }     while (!q.empty()) {       int x = q.front();       q.pop();       for (int i = 0; i < v[x].size(); i++) {         int to = v[x][i];         if (!used[to]) {           if (cnt[to] <= 2 && !t[x] && !never[to]) {             used[to] = 1;             q.push(to);           } else if (cnt[to] == 3 && !t[x] && !never[to]) {             t[to] = 1;           } else {             never[to] = 1;           }           cnt[to]--;         }       }     }     for (i = 1; i <= n; i++) {       if (cnt[i] >= 3) {         puts( no );         return 0;       }     }     puts( yes );   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     vector<int> a(n);     for (int i = 0; i < n; ++i) cin >> a[i];     for (int i = 0; i < n; ++i) a.push_back(a[i]);     int Max = 0, cur = 0;     for (int i = 0; i < 2 * n; ++i) {       if (a[i] == 1)         cur++;       else {         Max = max(Max, cur);         cur = 0;       }     }     cout << Max;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, co;     int a[100019];     cin >> n >> co;     int count = 0;     for (int i = 0; i < n; i++) {       cin >> a[i];       count += a[i] / 10;       a[i] %= 10;     }     sort(a, a + n);     reverse(a, a + n);     for (int i = 0; i < n; i++) {       if (co >= 10 - a[i]) {         count++;         co -= (10 - a[i]);       }     }     cout << min(10 * n, count + co / 10) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int mod = 1e9 + 7;   const double pi = acos(-1);   void print() { cout <<   n ; }   template <typename T, typename... Params>   void print(const T& var1, const Params&... var2) {     cout << var1 <<    ;     print(var2...);   }   template <typename T>   void pr(const T& v) {     for (auto c : v) cout << c <<    ;     cout <<   n ;   }   long long int power(long long int a, long long int b, long long int p) {     if (b == 0) return 1;     long long int c = power(a, b / 2, p);     if (b % 2 == 0)       return (c * c) % p;     else       return (((c * c) % p) * a) % p;   }   long long int invmod(long long int n, long long int p) {     return power(n, p - 2, p);   }   bool isPrime(long long int n) {     if (n <= 1) return false;     if (n <= 3) return true;     if (n % 2 == 0 || n % 3 == 0) return false;     for (long long int i = 5; i * i <= n; i = i + 6)       if (n % i == 0 || n % (i + 2) == 0) return false;     return true;   }   const int maxN = 100001;   int tree[4 * maxN][2];   int A[100000], n;   void build(int node, int start, int end) {     if (start == end)       tree[node][0] = A[start], tree[node][1] = start;     else {       int mid = (start + end) / 2;       build(2 * node, start, mid);       build(2 * node + 1, mid + 1, end);       tree[node][0] = min(tree[2 * node][0], tree[2 * node + 1][0]);       if (tree[2 * node][0] < tree[2 * node + 1][0])         tree[node][1] = tree[2 * node][1];       else         tree[node][1] = tree[2 * node + 1][1];     }   }   pair<int, int> query(int node, int start, int end, int l, int r) {     if (r < start or end < l) {       return {1e9, 1e9};     }     if (l <= start and end <= r) {       return make_pair(tree[node][0], tree[node][1]);     }     int mid = (start + end) / 2;     pair<int, int> p1 = query(2 * node, start, mid, l, r);     pair<int, int> p2 = query(2 * node + 1, mid + 1, end, l, r);     if (p1.first < p2.first)       return p1;     else       return p2;   }   vector<pair<int, int> > v;   int count(int l, int r, int val) {     if (l > r) return 0;     pair<int, int> q = query(1, 0, n - 1, l, r);     int mini = q.first;     int idx = q.second;     mini -= val;     for (long long int i = 0; i < mini; i++) v.push_back({l + 1, r + 1});     return (mini + count(l, idx - 1, val + mini) + count(idx + 1, r, val + mini));   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cin >> n;     for (long long int i = 0; i < n; i++) cin >> A[i];     build(1, 0, n - 1);     print(count(0, n - 1, 0));     for (long long int i = 0; i < ((long long int)(v).size()); i++)       print(v[i].first, v[i].second);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 + 5;   int n;   double a, d;   double p[maxn], t[maxn], v[maxn], s[maxn];   int main() {     scanf( %d %lf %lf , &n, &a, &d);     for (int i = 0; i < n; i++)       scanf( %lf%lf , &t[i], &v[i]), p[i] = t[i] + v[i] / a;     s[0] = t[0] + v[0] / a + (d - 0.5 * a * v[0] / a * v[0] / a) / v[0];     if (0.5 * a * v[0] / a * v[0] / a > d)       s[0] = min(s[0], t[0] + sqrt((d * 2) / a));     for (int i = 1; i < n; i++) {       s[i] = t[i] + v[i] / a + (d - 0.5 * a * v[i] / a * v[i] / a) / v[i];       if (0.5 * a * v[i] / a * v[i] / a > d)         s[i] = min(s[i], t[i] + sqrt((d * 2) / a));       s[i] = max(s[i], s[i - 1]);     }     for (int i = 0; i < n; i++) printf( %.6f n , s[i]);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     char a[5], b[5], aa[5][5];     for (int i = 1; i <= 3; i++) {       scanf( %s , aa[i]);       a[i] = aa[i][0];       b[i] = aa[i][1];     }     if ((a[1] == a[2]) && (a[2] == a[3]) && (b[1] == b[2]) && (b[2] == b[3])) {       printf( 0 n );       return 0;     }     if (!(strcmp(aa[1], aa[2])) || !strcmp(aa[2], aa[3]) ||         !strcmp(aa[1], aa[3])) {       printf( 1 n );       return 0;     }     int c[5], d[5];     for (int i = 1; i <= 3; i++) {       c[i] = a[i] - 48;       d[i] = a[i] - 48;     }     sort(c + 1, c + 4);     if (((c[3] - c[2]) == 1) && ((c[2] - c[1]) == 1) && (b[1] == b[2]) &&         (b[2] == b[3])) {       printf( 0 n );       return 0;     }     if (b[1] == b[2]) {       if ((abs(d[1] - d[2]) == 1) || (abs(d[1] - d[2]) == 2)) {         printf( 1 n );         return 0;       }     }     if (b[2] == b[3]) {       if ((abs(d[2] - d[3]) == 1) || (abs(d[3] - d[2]) == 2)) {         printf( 1 n );         return 0;       }     }     if (b[1] == b[3]) {       if ((abs(d[1] - d[3]) == 1) || (abs(d[1] - d[3]) == 2)) {         printf( 1 n );         return 0;       }     }     printf( 2 n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 10;   const long long inf = 9e18;   struct NODE {     long long v, id;     bool operator<(const NODE& other) const {       return v > other.v || (v == other.v && id > other.id);     }   } node[N];   long long a[N], b[N];   long long n;   long long f(long long x, long long y) { return x - 3LL * y * y + 3LL * y - 1; }   long long find(long long v, long long x) {     long long l, r, mid;     l = 0;     r = x + 1;     while (r - l > 1) {       mid = (l + r) >> 1;       if (f(x, mid) >= v)         l = mid;       else         r = mid;     }     return l;   }   long long solve(long long x) {     long long tot = 0, i;     for (i = 1; i <= n; i++) {       tot += (b[i] = find(x, a[i]));     }     return tot;   }   int main() {     long long k, i, cnt = 0;     long long l = inf, r = -inf, mid, tot;     cin >> n >> k;     for (i = 1; i <= n; i++) {       cin >> a[i];       l = min(l, f(a[i], a[i]));       r = max(r, f(a[i], 1));     }     while (r - l > 1) {       mid = (l + r) >> 1;       if (solve(mid) <= k)         r = mid;       else         l = mid;     }     tot = solve(r);     for (i = 1; i <= n; i++)       if (b[i] < a[i]) node[++cnt].v = f(a[i], b[i] + 1), node[cnt].id = i;     sort(node + 1, node + cnt + 1);     for (i = 1; i <= cnt; i++) {       if (tot == k) break;       b[node[i].id]++;       tot++;     }     for (i = 1; i <= n; i++) cout << b[i] <<    ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 10 + 1e5;   const int MOD = 1e9 + 7;   int n, m;   int a[MAXN], c[MAXN];   void Inout() {     freopen(          ABC           .inp ,          r , stdin);     freopen(          ABC           .out ,          w , stdout);   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     long long ans = 0;     for (int i = 1; i <= n; ++i) {       cin >> a[i];       c[i] = max(c[i - 1], a[i] + 1);     }     for (int i = n - 1; i; --i) c[i] = max(c[i], c[i + 1] - 1);     for (int i = 1; i <= n; ++i) {       ans += c[i] - a[i] - 1;     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long INF = 1e18;   const long long mod = 1e9 + 7;   const long long N = 2e5 + 10;   inline long long add(long long x, long long y) {     x += y;     if (x >= mod) x -= mod;     return x;   }   inline long long mul(long long x, long long y) {     x = (1LL * x * y) % mod;     return x;   }   long long first[N];   long long lvl[N];   int32_t main() {     ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);     long long n, k;     cin >> n >> k;     long long maxv = 0;     vector<long long> v(n);     for (long long i = 0; i <= n - 1; ++i) {       cin >> v[i];       first[v[i]]++;       maxv = max(maxv, v[i]);     }     long long ans = INF;     for (long long i = 0; i <= maxv; ++i) {       queue<long long> q;       q.push(i);       lvl[i] = 0;       long long val = 0;       long long cc = 0;       while (!q.empty()) {         long long x = q.front();         q.pop();         if (cc + first[x] > k) {           val += (k - cc) * lvl[x];           cc = k;           break;         } else {           cc += first[x];           val += first[x] * lvl[x];           if (i == 0) {           }         }         if (cc >= k) break;         if (2 * x <= 2e5 and x > 0) {           q.push(2 * x);           lvl[2 * x] = 1 + lvl[x];         }         if (2 * x + 1 <= 2e5) {           q.push(2 * x + 1);           lvl[2 * x + 1] = 1 + lvl[x];         }       }       if (cc < k) val = INF;       ans = min(ans, val);     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int A[1000000];   map<char, int> M;   int main() {     for (int i = 0; i <= 63; i++)       for (int j = 0; j <= 63; j++) A[i & j]++;     for (int i = 0; i <= 9; i++) M[i +  0 ] = i;     for (int i = 0; i < 26; i++) M[i +  A ] = i + 10;     for (int i = 0; i < 26; i++) M[i +  a ] = i + 36;     M[ _ ] = 63, M[ - ] = 62;     string s;     cin >> s;     long long ans = 1;     long long mod = 1e9 + 7;     for (int i = 0; i < s.size(); i++) ans = ans * A[M[s[i]]] % mod;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int inf = 0x3f3f3f3f;   const int maxn = 1000 + 10;   int n, maxLevel;   vector<int> edge[maxn];   vector<int> gu;   int dis[maxn];   vector<int> level[maxn];   int fa[maxn];   bool used[maxn];   void print(int a[], int n, int st = 0) {     for (int i = 0; i < n; i++) {       if (i != 0) printf(   );       printf( %d , a[i + st]);     }     printf(  n );   }   void init() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) edge[i].clear();     for (int i = 0; i < n - 1; i++) {       int x, y;       scanf( %d%d , &x, &y);       edge[x].push_back(y);       edge[y].push_back(x);     }   }   void guess(vector<int> a, int &u, int &value) {     printf( ? %d , int(a.size()));     for (int i = 0; i < a.size(); i++) printf(  %d , a[i]);     printf(  n );     fflush(stdout);     scanf( %d%d , &u, &value);   }   void answer(int u1, int u2) {     char s[20];     printf( ! %d %d n , u1, u2);     fflush(stdout);     scanf( %s , s);   }   void dfs(int u) {     for (int i = 0; i < edge[u].size(); i++) {       int v = edge[u][i];       if (dis[v] == -1) {         dis[v] = dis[u] + 1;         fa[v] = u;         maxLevel = max(maxLevel, dis[v]);         level[dis[v]].push_back(v);         dfs(v);       }     }   }   void doit() {     int r, len, k1, k2;     gu.clear();     for (int i = 1; i <= n; i++) gu.push_back(i);     guess(gu, r, len);     for (int i = 0; i <= n; i++) level[i].clear();     for (int i = 0; i <= n; i++) dis[i] = -1;     dis[r] = 0;     level[0].push_back(r);     maxLevel = 0;     dfs(r);     int left = (len + 1) / 2, right = min(len, maxLevel), mid, ans, u, d;     while (left <= right) {       mid = (left + right) >> 1;       guess(level[mid], u, d);       if (d <= len) {         ans = mid;         k1 = u;         left = mid + 1;       } else {         right = mid - 1;       }     }     if (ans == len) {       answer(r, k1);       return;     }     u = k1;     for (int i = 1; i <= n; i++) used[i] = false;     while (u != r) {       used[u] = true;       u = fa[u];     }     gu.clear();     for (int i = 0; i < level[len - ans].size(); i++) {       if (!used[level[len - ans][i]]) {         gu.push_back(level[len - ans][i]);       }     }     guess(gu, k2, d);     answer(k1, k2);   }   int main() {     int t;     scanf( %d , &t);     while (t--) {       init();       doit();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int i, ans, n, a[3001];     while (cin >> n) {       for (i = 0; i < n; i++) {         cin >> a[i];       }       sort(a, a + n);       if (a[0] > 1)         ans = 1;       else {         for (i = 1; i < n; i++) {           if (a[i] - a[i - 1] > 1) {             ans = a[i - 1] + 1;             break;           }         }       }       if (ans <= 0) ans = a[n - 1] + 1;       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct event {     long long x, type;     event() {}     event(long long _x, long long _type) {       x = _x;       type = _type;     }   };   string a, b;   long long n;   long double ans = 0;   vector<long long> v[500];   vector<event> d[500];   bool operator<(const event& a, const event& b) {     return a.x < b.x || (a.x == b.x && a.type < b.type);   }   int main() {     cin >> n;     cin >> a >> b;     for (long long i = 0; i < n; i++) {       v[a[i]].push_back(i);       d[a[i]].push_back(event(i, 0));       d[b[i]].push_back(event(i, 1));     }     long long all = 0;     for (long long i = 1; i <= n; i++) {       all += i * i;     }     for (long long i = 0; i < 500; i++) {       sort(d[i].begin(), d[i].end());       long long x = 0, y = 0;       for (long long j = 0; j < d[i].size(); j++) {         event q = d[i][j];         y += (n - q.x) * (1 - q.type);       }       for (long long j = 0; j < d[i].size(); j++) {         event q = d[i][j];         if (!q.type) {           y -= n - q.x;           x += q.x + 1;         } else {           ans += (long double)((q.x + 1) * y) / (long double)all;           ans += (long double)((n - q.x) * x) / (long double)all;         }       }     }     cout.precision(18);     cout << ans;     return 0;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:300000000 )   const long double eps = 1e-20;   const long double pi = acos(-1.0);   const long long inf = 1000 * 1000 * 1000 * 1000 * 1000 * 1000;   const long long base = 1000 * 1000 * 1000 + 7;   using namespace std;   int n, m, z, a[111111], x, y;   bool fl;   set<int> g[111111];   int main() {     ios_base ::sync_with_stdio(false);     cin >> n >> m;     for (int i = 0; i < (m); i++) {       cin >> x >> y;       x;       y;       g[x].insert(y);       g[y].insert(x);     }     for (int i = 0; i < (n); i++) a[i] = i + 1;     if (n < 9) {       do {         z = 0;         fl = true;         for (int i = 0; i < (n); i++) {           if (z == m) break;           if (g[a[i]].find(a[(i + 1) % n]) != g[a[i]].end()) {             fl = false;             break;           }           if (!fl) break;           z++;         }         if (fl && z == m) {           z = 0;           for (int i = 0; i < (n); i++) {             if (z == m) return 0;             cout << a[i] <<     << a[(i + 1) % n] << endl;             z++;           }           return 0;         }       } while (next_permutation(a, a + n));       cout <<  -1 ;       return 0;     }     for (int test = 0; test < (666); test++) {       random_shuffle(a, a + n);       z = 0;       fl = true;       for (int i = 0; i < (n); i++) {         if (z == m) break;         if (g[a[i]].find(a[(i + 1) % n]) != g[a[i]].end()) {           fl = false;           break;         }         if (!fl) break;         z++;       }       if (fl && z == m) {         z = 0;         for (int i = 0; i < (n); i++) {           if (z == m) return 0;           cout << a[i] <<     << a[(i + 1) % n] << endl;           z++;         }         return 0;       }     }     cout <<  -1 ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     while (cin >> n) {       vector<long long> nums(n);       for (int i = 0; i < n; i++) {         cin >> nums[i];       }       bool hasAns = false;       for (int i = 31; i >= 0; i--) {         long long num = 1;         num = num << i;         bool hasRes = false;         long long res = 0;         int count = 0;         for (int j = 0; j < nums.size(); j++) {           if (nums[j] & num) {             if (hasRes) {               res &= nums[j];             } else {               res = nums[j];             }             count++;             hasRes = true;           }         }         if (count == 0 || (res % num)) {           continue;         }         hasAns = true;         cout << count << endl;         for (int j = 0; j < nums.size(); j++) {           if (nums[j] & num) {             cout << nums[j] <<    ;           }         }         cout << endl;         break;       }       if (!hasAns) {         cout << nums.size() << endl;         for (int j = 0; j < nums.size(); j++) {           cout << nums[j] <<    ;         }         cout << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int add = 1e9;   const int INF = 2e9;   const long long mod = 1e9 + 7;   const long long mod1 = 3e9 + 19;   const long long mod2 = 3e9 - 71;   const long long longINF = 3e18;   const long long ph = 31;   const long double pi = acos(-1);   const long double eps = 1e-8;   const int M = 1 << 18;   int n, a[105], res;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     if (!(n & 1)) {       cout <<  No ;       return 0;     }     for (int i = 0; i < n; i++) cin >> a[i];     if (a[0] % 2 == 0 || a[n - 1] % 2 == 0) {       cout <<  No ;       return 0;     }     cout <<  Yes ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int tu[200], a[200];     int f[200];     int n, m, k;     int min;     int i, j;     scanf( %d %d %d , &n, &m, &k);     for (i = 0; i < m; i++) {       scanf( %d , &f[i]);       a[i] = 0;     }     for (i = 0; i < k; i++) scanf( %d , &tu[i]);     for (i = 0; i < m; i++)       for (j = 0; j < k; j++)         if (tu[j] % f[i] == 0) a[i] += 1;     min = 1000;     for (i = 0; i < m; i++) {       if (min > a[i]) min = a[i];     }     j = 0;     for (i = 0; i < m; i++) {       if (a[i] == min) tu[j++] = i;     }     for (i = 0; i < j; i++) {       for (k = i + 1; k < j; k++) {         if (tu[i] > tu[k]) {           min = tu[k];           tu[k] = tu[i];           tu[i] = min;         }       }     }     printf( %d n , j);     for (i = 0; i < j; i++) printf( %d  , tu[i] + 1);     printf(  n );     return 0;   }