malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int find_set(int v, vector<int> &p) {     if (v == p[v]) return v;     return p[v] = find_set(p[v], p);   }   void union_set(int a, int b, vector<int> &p) {     a = find_set(a, p);     b = find_set(b, p);     if (a != b) {       p[b] = a;     }   }   long long int ans = 0;   void dfs(int i, vector<int> &vis, vector<int> adj[]) {     vis[i] = 1;     for (int k = 0; k < adj[i].size(); k++) {       if (vis[adj[i][k]] == 0) {         dfs(adj[i][k], vis, adj);       }     }   }   void solve() {     int n, m;     cin >> n >> m;     vector<int> adj[n];     int a, b;     for (int i = 0; i < m; i++) {       cin >> a >> b;       a--;       b--;       adj[a].push_back(b);       adj[b].push_back(a);     }     vector<int> vis(n, 0);     dfs(0, vis, adj);     if (find(vis.begin(), vis.end(), 0) != vis.end()) {       cout <<  NO  << endl;       return;     }     if (m - n + 1 == 1) {       cout <<  FHTAGN!  << endl;       return;     }     cout <<  NO  << endl;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long int T;     T = 1;     while (T--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   int num[30];   char ans[100050];   int gcd(int a, int b) {     if (b == 0) return a;     return gcd(b, a % b);   }   int main() {     cin >> n;     int neven = 0;     int sut = 0;     for (int i = 0; i < n; i++) {       cin >> num[i];       if (num[i] % 2) neven++;       sut += num[i];     }     if (n == 1) {       printf( %d n , num[0]);       for (int i = 1; i <= num[0]; i++) printf( a );       puts(  );       return 0;     }     if (neven > 1) {       puts( 0 );       for (int i = 0; i < n; i++)         for (int k = 0; k < num[i]; k++) printf( %c ,  a  + i);       puts(  );     } else {       int counts = num[0];       for (int i = 1; i < n; i++) {         counts = gcd(counts, num[i]);       }       if (counts % 2 == 1) {         int l = 1, r = sut / counts;         for (int i = 0; i < n; i++) {           if (num[i] & 1) {             num[i]--;             ans[(sut / counts + 1) / 2] = i +  a ;           }           for (int k = num[i] / counts; k > 0; k -= 2) {             ans[l++] = i +  a ;             ans[r--] = i +  a ;           }         }         l = sut / counts + 1;         int subarry = sut / counts;         for (int i = 2; i <= counts; i++) {           for (int k = 1; k <= subarry; k++) {             ans[l] = ans[l - (k * 2 - 1)];             l++;           }         }         printf( %d n , counts);       } else {         int subarry = sut / counts;         int l = 1;         for (int i = 0; i < n; i++) {           for (int k = 1; k <= num[i] / counts; k++) ans[l++] = i +  a ;         }         for (int i = 2; i <= counts; i++) {           for (int k = 1; k <= subarry; k++) {             ans[l] = ans[l - (k * 2 - 1)];             l++;           }         }         printf( %d n , counts);       }       for (int i = 1; i <= sut; i++) {         printf( %c , ans[i]);       }       puts(  );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, b, g, x, y;     bool women[100], man[100];     cin >> n >> m;     cin >> b;     for (int i = 0; i < n; i++) man[i] = 0;     for (int i = 0; i < m; i++) women[i] = 0;     for (int i = 0; i < b; i++) {       cin >> x;       man[x] = 1;     }     cin >> g;     for (int i = 0; i < g; i++) {       cin >> y;       women[y] = 1;     }     for (int i = 0; i <= (n * m) * (n * m); i++) {       if (man[i % n] == 1)         women[i % m] = 1;       else {         if (women[i % m] == 1) man[i % n] = 1;       }     }     bool flag1 = 1, flag2 = 1;     for (int i = 0; i < n; i++) flag1 *= man[i];     for (int i = 0; i < m; i++) flag2 *= women[i];     if (flag1 == 1 && flag2 == 1)       cout <<  Yes ;     else       cout <<  No ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s;     getline(cin, s);     bool in_quotes{false};     string sub;     vector<string> vec;     for (int i{}; i < s.size(); ++i) {       if (s[i] ==    ) {         if (!in_quotes) {           in_quotes = true;           if (!sub.empty()) vec.push_back(sub);           sub.clear();         } else {           in_quotes = false;           vec.push_back(sub);           sub.clear();         }       } else {         if (in_quotes) {           sub += s[i];         } else {           if (s[i] !=    ) {             sub += s[i];             if (i == s.size() - 1) {               if (!sub.empty()) vec.push_back(sub);             }           } else {             if (!sub.empty()) vec.push_back(sub);             sub.clear();           }         }       }     }     for (auto val : vec) cout <<  <  << val <<  > n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long inf = INT_MAX, df = 4e5 + 7;   priority_queue<pair<long long, long long>> que[df];   int i, j, k, l, m, n, o, q, s, t, u, v, w, x, y, z, tot, cur[df], pos[df];   long long r[df], p[df], d[df], b[df], a[df];   inline long long read() {     long long x = 0, y = 1;     char ch = getchar();     while (ch >  9  || ch <  0 ) y = (ch ==  - ) ? -1 : 1, ch = getchar();     while (ch >=  0  && ch <=  9 )       x = (x << 3) + (x << 1) + ch -  0 , ch = getchar();     return x * y;   }   int main() {     x = read(), y = read(), p[0] = read(), r[0] = read(), n = read();     r[0] *= r[0], tot = 0;     for (int i = (1); i <= (n); ++i) {       s = read(), t = read(), m = read(), p[i] = read(), r[i] = read();       d[i] = 1ll * (s - x) * (s - x) + 1ll * (t - y) * (t - y), r[i] *= r[i];       b[i] = m;       a[++tot] = m;       pos[i] = 1;     }     sort(a + 1, a + tot + 1), tot = unique(a + 1, a + tot + 1) - a - 1;     int cnt = 0;     for (int i = (1); i <= (n); ++i)       for (int j = lower_bound(a + 1, a + tot + 1, b[i]) - a; j <= tot;            j += j & -j)         que[j].push(make_pair(-d[i], i));     for (cur[0] = i = 0; i <= cnt; ++i) {       for (int j = upper_bound(a + 1, a + tot + 1, p[cur[i]]) - a - 1; j;            j -= j & -j) {         for (; (!que[j].empty()) && -que[j].top().first <= r[cur[i]];              que[j].pop())           if (pos[que[j].top().second]) pos[cur[++cnt] = que[j].top().second] = 0;       }     }     return printf( %d n , cnt), 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int i, j, n, m, flag = 0, cnt = 0, temp;     cin >> n >> m;     char a[108][106];     for (i = 0; i < n; i++) {       cin >> a[i];     }     for (i = 0; i < n; i++) {       for (j = 0; j < m; j++) {         cnt = 0;         if (a[i][j] ==  . ) {           if (a[i - 1][j] ==  *  || a[i - 1][j - 1] ==  *  ||               a[i][j - 1] ==  *  || a[i + 1][j] ==  *  || a[i][j + 1] ==  *  ||               a[i + 1][j + 1] ==  *  || a[i - 1][j + 1] ==  *  ||               a[i + 1][j - 1] ==  * )             flag = 1;         } else if (a[i][j] ==  * )           continue;         else {           if (a[i - 1][j] ==  * ) cnt++;           if (a[i - 1][j - 1] ==  * ) cnt++;           if (a[i][j - 1] ==  * ) cnt++;           if (a[i + 1][j] ==  * ) cnt++;           if (a[i + 1][j + 1] ==  * ) cnt++;           if (a[i][j + 1] ==  * ) cnt++;           if (a[i - 1][j + 1] ==  * ) cnt++;           if (a[i + 1][j - 1] ==  * ) cnt++;           temp = (int)(a[i][j] -  0 );           if (cnt != temp) flag = 1;         }       }     }     if (flag == 1)       cout <<  NO ;     else       cout <<  YES ;   }
#include <bits/stdc++.h>   using namespace std;   int32_t main() {     long long n;     cin >> n;     vector<pair<long long, long long>> a(n);     for (long long i = 0; i < n; ++i) {       cin >> a[i].first >> a[i].second;       a[i].first *= 2;       a[i].second *= 2;     }     if (n % 2) {       cout <<  NO ;       return 0;     }     long long x, y;     x = (a[0].first + a[n / 2].first) / 2;     y = (a[0].second + a[n / 2].second) / 2;     vector<long long> q(n);     for (long long i = 0; i < n; ++i) {       long long d = (x - a[i].first) * (x - a[i].first) +                     (y - a[i].second) * (y - a[i].second);       q[i] = d;     }     bool ok = true;     for (long long i = 0; i < n; ++i) {       if (q[i] != q[(i + n / 2) % n]) {         ok = 0;       }       if (2 * x != (a[i].first + a[(i + n / 2) % n].first)) ok = 0;       if (2 * y != (a[i].second + a[(i + n / 2) % n].second)) ok = 0;     }     if (ok) {       cout <<  YES n ;     } else {       cout <<  NO ;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long t;     cin >> t;     while (t--) {       long long n;       cin >> n;       set<long long> d[n + 1];       vector<long long> kingdom(n + 1, 0);       for (long long i = 1; i < n + 1; i++) {         long long k, x;         cin >> k;         for (long long j = 1; j < k + 1; j++) {           cin >> x;           d[i].insert(x);         }       }       vector<long long> none;       for (long long i = 1; i < n + 1; i++) {         long long flag = 0;         for (auto x : d[i]) {           if (kingdom[x] != 1) {             kingdom[x] = 1;             flag = 1;             break;           }         }         if (flag == 0) {           none.push_back(i);         }       }       long long index2 = -1;       long long index = -1;       for (long long i = 1; i < n + 1; i++) {         for (long long j = 0; j < none.size(); j++) {           if (kingdom[i] == 0 && d[none[j]].find(i) == d[none[j]].end()) {             index2 = i;             index = none[j];             break;           }         }         if (index2 != -1) {           break;         }       }       if (none.size() == 0 || index2 == -1) {         cout <<  OPTIMAL  n ;       } else {         cout <<  IMPROVE  n ;         cout << index <<     << index2 <<   n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     long long a, b;     cin >> a >> b;     if (a == b) {       cout << a << endl;       return;     } else if (a > b) {       cout << a + b << endl;       return;     } else {       if (b % a == 0) {         cout << b << endl;         return;       } else {         long long x = b - a - b % a;         if (x == 0) {           cout << a + (b - a) / 2;         } else {           cout << (b + x) / 2;         }         cout << endl;         return;       }     }     cout << -1 << endl;   }   signed main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     int t = 1;     cin >> t;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, t1, t2, k, a[1005], b[1005];   vector<pair<double, int> > ans;   bool cmp(pair<double, int> x, pair<double, int> y) {     if (fabs(x.first - y.first) < 1e-5) return x.second < y.second;     return x.first > y.first;   }   double h(int x, int y) {     return (double)x * t1 * (100.0 - k) / 100.0 + (double)y * t2;   }   int main() {     scanf( %d%d%d%d , &n, &t1, &t2, &k);     for (int i = 0; i < n; ++i) scanf( %d%d , &a[i], &b[i]);     for (int i = 0; i < n; ++i) {       ans.push_back(make_pair(max(h(a[i], b[i]), h(b[i], a[i])), i));     }     sort((ans).begin(), (ans).end(), cmp);     for (int i = 0; i < n; ++i)       printf( %d %.2lf n , ans[i].second + 1, ans[i].first);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int F[100000], S[100000];   int main(int argc, char *argv[]) {     int n, x, adg, i, j, k, L, A, B;     cin >> n >> x;     for (i = 0; i < n; i++) cin >> F[i];     for (i = 0; i < n; i++) cin >> S[i];     if (n == 1)       cout << 1 <<     << 1;     else {       cout << 1 <<    ;       sort(F, F + n);       sort(S, S + n);       adg = 0;       j = L = 0;       i = k = n - 1;       while (adg < n && i >= L && k >= j) {         A = F[i] + S[j];         B = S[k] + F[L];         if (A >= B && A >= x) {           adg++;           i--;           j++;         } else if (B > A && B >= x) {           adg++;           k--;           L++;         } else if (A < B)           j++;         else           L++;       }       cout << adg;     }     return EXIT_SUCCESS;   }
#include <bits/stdc++.h>   using namespace std;   long long int gcd(long long int a, long long int b) {     if (a == 0) {       return b;     } else {       return gcd(b % a, a);     }   }   long long int lcm(long long int a, long long int b) {     return a * b / gcd(a, b);   }   int f(char c) { return (int)c - 48; }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     ;     int t;     cin >> t;     while (t--) {       long long int n, x;       cin >> n >> x;       long long int a[1005];       long long int sum = 0;       long long int count = 0;       for (int i = 1; i <= n; i++) {         cin >> a[i];         sum += (a[i] - x);         if (a[i] == x) {           count++;         }       }       if (count == n) {         cout << 0 << endl;       } else if (count > 0) {         cout << 1 << endl;       } else if (sum == 0) {         cout << 1 << endl;       } else {         cout << 2 << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int Maxn = 500005;   int n;   int a[Maxn];   long long L[Maxn], R[Maxn];   int delt[Maxn];   long long res;   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       L[i] = L[i - 1] + a[i];     }     if (L[n] % 3)       printf( 0 n );     else {       long long need = L[n] / 3;       for (int i = n; i >= 1; i--) {         R[i] = R[i + 1] + a[i];         delt[i] = delt[i + 1] + (R[i] == need);       }       for (int i = 1; i <= n; i++)         if (L[i] == need) res += delt[i + 2];       printf( %I64d n , res);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int INF = 1000000007;   const int N = 100000 + 7;   int power(int x, unsigned int y) {     int res = 1;     while (y > 0) {       if (y & 1) res = res * x;       y = y >> 1;       x = x * x;     }     return res;   }   int GCD(int A, int B) {     if (B == 0)       return A;     else       return GCD(B, A % B);   }   string decToBin(int number) {     if (number == 0) return  0 ;     if (number == 1) return  1 ;     if (number % 2 == 0)       return decToBin(number / 2) +  0 ;     else       return decToBin(number / 2) +  1 ;   }   int binToDec(string number) {     int result = 0, pow = 1;     for (int i = number.length() - 1; i >= 0; --i, pow <<= 1)       result += (number[i] -  0 ) * pow;     return result;   }   void seive(int n) {     vector<int> primeNums;     bool prime[n + 1];     memset(prime, true, sizeof(prime));     for (int p = 2; p * p <= n; p++) {       if (prime[p]) {         for (int i = 2 * p; i <= n; i += p) prime[i] = false;       }     }     for (int i = 2; i <= n; i++) {       if (prime[i]) {         primeNums.push_back(i);       }     }   }   long long powerMod(long long x, int y, int m) {     x = x % m;     long long res = 1;     while (y > 0) {       if (y & 1) {         res = (res * x) % m;       }       y = y >> 1;       x = (x * x) % m;     }     return res;   }   long long D, X, Y;   void extendedEuclid(int a, int b) {     if (b == 0) {       D = a;       X = 1;       Y = 0;     } else {       extendedEuclid(b, a % b);       int temp = X;       X = Y;       Y = temp - (a / b) * Y;     }   }   long long solve(long long n) {     if (n == 1) return 0;     return n / 2 + 2 * solve((n + 1) / 2);   }   int main() {     long long n;     cin >> n;     cout << solve(n) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 200010;   int n, t[N];   int main() {     scanf( %d , &n);     set<int> st;     int ans = 0;     for (int i = 0; i < n; i++) scanf( %d , &t[i]);     for (int i = 1; i <= n; i++) {       set<int>::iterator it = st.lower_bound(t[i - 1]);       int cur = *it;       if (it == st.end() || cur != t[i - 1]) {         ans++;       } else {         st.erase(it);       }       st.insert(i);     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   typedef int STDD[1010];   struct lst {     int po;     int num;     lst* nxt;   };   lst* hd[1001];   int n, m, sx, sy, ans = 2E9 + 1, a1, a2;   STDD seq, tseq, fa, clr, far;   int x[30010], y[30010], z[30010];   bool vis[1001];   int getfa(int x) { return (fa[x] != x) ? (fa[x] = getfa(fa[x])) : (x); }   bool dfs(int x, int fb) {     vis[x] = 1;     if (x == sy) return 1;     for (lst* p = hd[x]; p; p = p->nxt)       if (!vis[p->po] && p->num != fb) {         seq[++seq[0]] = p->num;         if (!dfs(p->po, fb))           --seq[0];         else           return 1;       }     return 0;   }   int main() {     scanf( %d%d%d%d , &n, &m, &sx, &sy);     for (int i = 1; i <= m; ++i) {       scanf( %d%d%d , x + i, y + i, z + i);       hd[x[i]] = new lst{y[i], i, hd[x[i]]};       ;       hd[y[i]] = new lst{x[i], i, hd[y[i]]};       ;     }     if (!dfs(sx, 0)) {       printf( 0 n0 n );       return 0;     }     for (int i = 0; i <= seq[0]; ++i) tseq[i] = seq[i];     for (int i = 1; i <= tseq[0]; ++i) {       memset(vis, 0, sizeof(vis));       seq[0] = 0;       if (!dfs(sx, tseq[i]) && ans > z[tseq[i]]) {         ans = z[tseq[i]];         a1 = tseq[i];         a2 = 0;         continue;       }       memset(clr, 0, sizeof(clr));       for (int j = 1; j <= n; ++j) far[j] = fa[j] = j;       for (int j = 1; j <= seq[0]; ++j) z[seq[j]] *= -1;       z[tseq[i]] *= -1;       for (int j = 1; j <= m; ++j)         if (z[j] > 0) fa[getfa(x[j])] = getfa(y[j]);       for (int j = 1; j <= seq[0]; ++j) z[seq[j]] *= -1;       z[tseq[i]] *= -1;       int cr = clr[sx] = 1;       for (int j = 1; j <= seq[0]; ++j)         clr[(!clr[x[seq[j]]]) ? (x[seq[j]]) : (y[seq[j]])] = ++cr;       for (int j = 1; j <= n; ++j)         if (clr[far[getfa(j)]] < clr[j]) far[getfa(j)] = j;       int now = far[getfa(sx)];       for (int j = 1; j <= seq[0]; ++j) {         if (clr[x[seq[j]]] > clr[y[seq[j]]]) swap(x[seq[j]], y[seq[j]]);         if (clr[now] >= clr[y[seq[j]]]) {           if (clr[far[getfa(y[seq[j]])]] > clr[now]) now = far[getfa(y[seq[j]])];           continue;         }         if (z[tseq[i]] + z[seq[j]] < ans) {           ans = z[tseq[i]] + z[seq[j]];           a1 = tseq[i];           a2 = seq[j];         }         now = far[getfa(y[seq[j]])];       }     }     if (!a1)       printf( -1 n );     else if (!a2)       printf( %d n1 n%d n , ans, a1);     else       printf( %d n2 n%d %d n , ans, a1, a2);   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 3;   const long long MOD = 1e9 + 7;   const long long INF = 2e9;   const int fullmask = (1 << 10) - 1;   long long fpow(int n, int p) {     if (!p) return 1;     if (p == 1) return n;     long long tmp = fpow(n, p / 2);     if (p & 1) return tmp * tmp % MOD * n % MOD;     return tmp * tmp % MOD;   }   long long Hash[10][10];   int k, n, m, u, v, w, c[10], ans;   vector<pair<int, int> > g[N];   void solve(int id) {     if (id > k) {       long long op = 0;       for (int i = 1; i <= k; i++) op += Hash[i][c[i]], op %= MOD;       if (op == ((fpow(2, n + 1) - 2 + MOD) % MOD)) ans++;       return;     }     for (int i = 1; i <= id; i++) {       c[id] = i;       solve(id + 1);     }   }   void process() {     cin >> n >> m >> k;     for (int i = 1; i <= m; i++) {       cin >> u >> v >> w;       g[u].push_back(pair<int, int>(w, v));     }     for (int i = 1; i <= n; i++) sort(g[i].begin(), g[i].end());     for (int i = 1; i <= n; i++) {       int deg = g[i].size();       for (int j = 1; j <= deg; j++) {         int v = g[i][j - 1].second;         Hash[deg][j] += fpow(2, v);         Hash[deg][j] %= MOD;       }     }     solve(1);     cout << ans << endl;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie();     process();   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int a = -2147483647, b = 0;     for (int i = 0; i < n - 1; ++i) {       int x;       cin >> x;       a = max(a, x);     }     cin >> b;     a = max(a, b);     cout << (int)(a ^ b);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     if (n % 2 == 1) {       string input;       cin >> input;       cout <<  No  << endl;       return 0;     }     stack<char> parenthesis;     char input;     bool flag = true;     cin >> input;     parenthesis.push(input);     for (int i = 1; i < n; i++) {       cin >> input;       if (parenthesis.empty())         parenthesis.push(input);       else if (parenthesis.top() ==  (  && input ==  ) ) {         parenthesis.pop();       } else {         parenthesis.push(input);       }     }     if (parenthesis.empty())       cout <<  Yes  << endl;     else if (parenthesis.size() > 2)       cout <<  No  << endl;     else {       input = parenthesis.top();       parenthesis.pop();       if (parenthesis.top() ==  )  && input ==  ( )         cout <<  Yes  << endl;       else         cout <<  No  << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   const int MAX_N = 300100;   const int MOD = 998244353;   inline int mnoz(long long a, long long b) {     a *= b;     a %= MOD;     return a;   }   inline int dodaj(long long a, long long b) {     a += b;     a %= MOD;     return a;   }   long long quick_pow(int i, int x) {     int wynik = 1;     while (x) {       if (x % 2) wynik = mnoz(wynik, i);       i = mnoz(i, i);       x >>= 1;     }     return wynik;   }   int odwr(int i) { return quick_pow(i, MOD - 2); }   int n;   vector<vector<int> > tree(MAX_N);   int bez_kraw[MAX_N];   int czeka[MAX_N];   int ma_pod[MAX_N];   int p[MAX_N];   void wczytaj() {     cin >> n;     for (int i = 1; i <= n - 1; i++) {       int a, b;       cin >> a >> b;       tree[a].push_back(b);       tree[b].push_back(a);     }   }   void licz(int i) {     czeka[i] = 1;     bez_kraw[i] = 1;     for (__typeof(tree[i].begin()) it = tree[i].begin(); it != tree[i].end();          it++)       if (*it != p[i]) {         p[*it] = i;         licz(*it);         czeka[i] = mnoz(czeka[i], dodaj(mnoz(ma_pod[*it], 2), bez_kraw[*it]));         bez_kraw[i] = mnoz(bez_kraw[i], dodaj(ma_pod[*it], bez_kraw[*it]));       }     for (__typeof(tree[i].begin()) it = tree[i].begin(); it != tree[i].end();          it++)       if (*it != p[i])         ma_pod[i] =             dodaj(ma_pod[i],                   mnoz(czeka[*it], mnoz(czeka[i], odwr(dodaj(mnoz(ma_pod[*it], 2),                                                              bez_kraw[*it])))));   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     wczytaj();     licz(1);     int wynik = dodaj(bez_kraw[1], ma_pod[1]);     cout << wynik << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int MAX = 1000000007;   const long long int MAXN = 100005;   int solve() {     int n, sx = 0, sy = 0, ans = -1;     cin >> n;     int x[n], y[n];     for (int i = 0; i < n; i++) {       cin >> x[i] >> y[i];       sx += x[i];       sy += y[i];     }     if (sx % 2 == 0 && sy % 2 == 0)       cout <<  0  << endl;     else if (sx % 2 == 0 && sy % 2 == 1 || sx % 2 == 1 && sy % 2 == 0) {       cout <<  -1 ;     } else if (sx % 2 == 1 && sy % 2 == 1) {       for (int i = 0; i < n; i++) {         if (x[i] % 2 == 0 && y[i] % 2 == 1 || x[i] % 2 == 1 && y[i] % 2 == 0) {           ans = 1;           break;         }       }       cout << ans;     }     return 0;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long int t;     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long maxn = 100;   string v[maxn];   long long cn[26];   char mp[101][10000];   signed main() {     long long n;     cin >> n;     string ts =  aouie ;     for (long long i = 5; i < n && n / i >= 5; i++) {       if (n % i) continue;       for (long long j = 0; j < i; j++)         for (long long l = 0; l < n / i; l++) mp[j][l] = ts[(j + l) % 5];       for (long long j = 0; j < i; j++) {         for (long long l = 0; l < n / i; l++) cout << mp[j][l];       }       return 0;     }     cout << -1;     return 0;   }