malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   long long P(long long m, long long n);   long long pi(long long x);   long long phi(long long m, long long n);   bool isprm[400005];   int cntprm[400005];   vector<long long> prm;   void Init() {     for (int i = 2; i <= 400000; ++i) {       isprm[i] = true;     }     for (int i = 2; i <= 400000; ++i) {       cntprm[i] = cntprm[i - 1] + isprm[i];       if (isprm[i]) {         prm.push_back(i);         for (int j = i + i; j <= 400000; j += i) isprm[j] = false;       }     }   }   long long sol(long long x) {     long long ans = 0;     long long sq = sqrt(x);     for (int i = 0; i < (int)prm.size() && prm[i] <= sq; ++i) {       long long a = prm[i], b = x / a;       if (b <= 400000)         ans += cntprm[b] - cntprm[a];       else {         ans += pi(b) - cntprm[a];       }     }     return ans;   }   int main(void) {     long long n;     Init();     cin >> n;     cout << cntprm[(int)cbrt(n)] + sol(n) <<   n ;   }   long long phi(long long m, long long n) {     if (m) {       if (n) {         if (m <= prm[n - 1])           return 1;         else {           if (prm[n - 1] * prm[n - 1] >= m)             return pi(m) - n + 1;           else             return phi(m, n - 1) - phi(m / prm[n - 1], n - 1);         }       } else {         return m;       }     } else {       return 0;     }   }   long long P(long long m, long long n) {     long long res = 0, sq = sqrt(m);     for (int i = n; i < (int)prm.size() && prm[i] <= sq; ++i) {       auto num = prm[i];       res += pi(m / num) - pi(num) + 1;     }     return res;   }   long long pi(long long x) {     if (x <= 400000)       return cntprm[x];     else {       long long n = pi(ceil(cbrt(x))), m = x;       return phi(m, n) + n - 1 - P(m, n);     }   }
#include <bits/stdc++.h>   using namespace std;   string numToBinary(int n, int digits) {     string s;     while (n) {       int bil = n % 2;       n /= 2;       s += (bil +  0 );     }     while (s.size() < digits) {       s +=  0 ;     }     reverse(s.begin(), s.end());     return s;   }   long long computeInv(const vector<int>& a) {     int sz = a.size();     int suff[sz + 1], i;     suff[sz] = 0;     for (i = sz - 1; i >= 0; i--) {       suff[i] = suff[i + 1];       if (a[i] == 0) {         suff[i]++;       }     }     long long ans = 0;     for (i = 0; i < sz; i++) {       if (a[i] == 1) {         ans += suff[i + 1];       }     }     return ans;   }   void cetak(const vector<int>& a) {     for (int i = 0; i < a.size(); i++) {       printf( %d  , a[i]);     }     printf(  n );   }   int main() {     int n, i, j;     int a[300001];     while (scanf( %d , &n) != EOF) {       for (i = 0; i < n; i++) {         scanf( %d , &a[i]);       }       vector<vector<int> > groups;       vector<int> awalMula;       for (i = 0; i < n; i++) {         awalMula.push_back(i);       }       groups.push_back(awalMula);       int sor = 0;       long long numInv = 0;       for (i = 29; i >= 0; i--) {         long long invXor = 0;         long long invOri = 0;         for (j = 0; j < groups.size(); j++) {           vector<int> inv, asli;           for (int k = 0; k < groups[j].size(); k++) {             int idx = groups[j][k];             if ((1 << i) & a[idx]) {               asli.push_back(1);               inv.push_back(0);             } else {               asli.push_back(0);               inv.push_back(1);             }           }           invOri += computeInv(asli);           invXor += computeInv(inv);         }         if (invXor < invOri) {           sor += (1 << i);           for (j = 0; j < n; j++) {             a[j] ^= (1LL << i);           }           numInv += invXor;         } else {           numInv += invOri;         }         vector<vector<int> > newGroups;         for (j = 0; j < groups.size(); j++) {           vector<int> group0, group1;           for (int k = 0; k < groups[j].size(); k++) {             int idx = groups[j][k];             int nilai;             if ((1 << i) & a[idx]) {               group1.push_back(idx);             } else {               group0.push_back(idx);             }           }           if (group1.size()) {             newGroups.push_back(group1);           }           if (group0.size()) {             newGroups.push_back(group0);           }         }         groups = newGroups;       }       printf( %lld %d n , numInv, sor);     }     return 0;   };
#include <bits/stdc++.h>   using namespace std;   const int maxn = 150000 + 7;   const long long mod = 1e9 + 7;   const long long INF = 5e18 + 7;   const int inf = 1e9 + 7;   const long long maxx = 1e6 + 700;   int main() {     int n, m, i;     scanf( %d%d , &n, &m);     i = max(2 * n, 3 * m);     while (i / 2 + i / 3 - i / 6 < n + m || i / 2 < n || i / 3 < m) {       i++;     }     printf( %d , i);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 10010;   const int M = 15;   const double eps = 1e-7;   const int INF = 1 << 30;   int n;   struct node {     double x, y, z;     node() { x = y = z = 0; }     node(double xx, double yy, double zz) {       x = xx;       y = yy;       z = zz;     }   } poy[N], ori;   double vp, vs, prelen;   int ln;   double ABS(double x) {     while (x < 0) x = -x;     return x;   }   double dist(node a, node b) {     double tmp = 0;     tmp += (a.x - b.x) * (a.x - b.x);     tmp += (a.y - b.y) * (a.y - b.y);     tmp += (a.z - b.z) * (a.z - b.z);     return sqrt(tmp);   }   void init() {     double x, y, z;     for (int i = 1; i <= n + 1; i++) {       cin >> x >> y >> z;       poy[i] = node(x, y, z);     }     cin >> vp >> vs;     cin >> x >> y >> z;     ori = node(x, y, z);   }   bool solve() {     double t = 0;     for (int i = 2; i <= n + 1; i++) {       double len = dist(ori, poy[i]) / vp;       double edge = dist(poy[i - 1], poy[i]) / vs;       t += edge;       if ((t - len) >= -eps) {         ln = i;         prelen = t - edge;         return 1;       }     }     return 0;   }   node getmid(node a, node b) {     double xx, yy, zz;     xx = (a.x + b.x) * 0.5;     yy = (a.y + b.y) * 0.5;     zz = (a.z + b.z) * 0.5;     return node(xx, yy, zz);   }   void cal() {     node pre = poy[ln - 1];     node l = poy[ln - 1], r = poy[ln];     double t;     while (ABS(dist(l, r)) > eps) {       node mid = getmid(l, r);       double len1 = dist(ori, mid);       double len2 = dist(mid, pre);       double t1 = len1 / vp;       double t2 = len2 / vs + prelen;       t = t1;       if ((t1 - t2) < 1e-15)         r = mid;       else         l = mid;     }     printf( %.10lf n%.10lf %.10lf %.10lf n , t, l.x, l.y, l.z);   }   int main() {     while (cin >> n) {       init();       if (solve())         cout <<  YES  << endl;       else {         cout <<  NO  << endl;         continue;       }       cal();     }   }
#include <bits/stdc++.h>   using namespace std;   char q[7][50] = { Anka ,    Chapay ,  Cleo ,        Troll ,                     Dracul ,  Snowy ,   Hexadecimal };   map<string, int> h;   int a[3], u[7], v[3], w[7], r, rb, m[7][7];   void upd() {     int i, mx, mn, j, k;     for (i = 0; i < 3; v[i] = 0, i++)       ;     for (i = 0; i < 7; v[u[i]]++, i++)       ;     for (i = 0; i < 3; i++)       if (!v[i]) return;     for (i = 0; i < 7; w[i] = a[u[i]] / v[u[i]], i++)       ;     for (mx = w[0], mn = w[0], i = 1;          i<7; mx = w[i]> mx ? w[i] : mx, mn = w[i] < mn ? w[i] : mn, i++)       ;     for (k = 0, i = 0; i < 7; i++)       for (j = 0; j < 7; k += m[i][j] && u[i] == u[j], j++)         ;     if (mx - mn < r || (mx - mn == r && k > rb)) {       r = mx - mn;       rb = k;     }   }   void rec(int i) {     if (i == 7)       upd();     else       for (u[i] = 0; u[i] < 3; rec(i + 1), u[i]++)         ;   }   int main() {     ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0), cerr <<   ;     int i, j, t;     char s[100];     for (i = 0; i < 7; h[q[i]] = i, i++)       ;     for (cin >> t; t--;) {       cin >> s;       i = h[s];       cin >> s >> s;       j = h[s];       m[i][j] = 1;     }     for (i = 0; i < 3; cin >> a[i], i++)       ;     r = 2000000010;     rec(0);     cout << r <<     << rb << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mxprime = 2750131;   int prime[mxprime + 1], res;   int func(int n) {     for (int i = 2; i * i <= n; i++)       if (n % i == 0) return n / i;   }   vector<int> ord(mxprime, false);   int vc[500001];   int main() {     int n;     cin >> n;     prime[1] = true;     map<int, int> mp;     for (int i = 2; i * i <= mxprime; i++) {       if (!prime[i]) {         for (int j = i * i; j <= mxprime; j += i) {           prime[j] = true;         }       }     }     for (int i = 2; i <= mxprime; i++) {       if (!prime[i]) {         ord[i] = ++res;       }     }     vector<int> a;     n = n * 2;     for (int i = 1; i <= n; i++) {       cin >> vc[i];       mp[vc[i]]++;     }     sort(vc + 1, vc + n + 1, greater<int>());     for (int i = 1; i <= n; i++) {       if (!mp[vc[i]]) continue;       if (!prime[vc[i]]) {         a.push_back(ord[vc[i]]);         mp[ord[vc[i]]]--;       } else {         a.push_back(vc[i]);         mp[func(vc[i])]--;       }       mp[vc[i]]--;     }     for (int i = 0; i < a.size(); i++) {       cout << a[i] <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int c1 = 0, n, t;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> t;       if (t % 2 == 1) {         c1++;       }     }     cout << min(c1, n - c1 + (2 * c1 - n) / 3) <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 10;   int T, n, a, b, c;   string s;   int shi, bu, jian;   int main() {     cin >> T;     while (T--) {       shi = bu = jian = 0;       cin >> n;       cin >> a >> b >> c;       cin >> s;       for (int i = 0; i < s.length(); i++) {         if (s[i] ==  R )           shi++;         else if (s[i] ==  P )           bu++;         else           jian++;       }       if (min(a, jian) + min(b, shi) + min(c, bu) < (n + 1) / 2) {         cout <<  NO  << endl;         continue;       }       cout <<  YES  << endl;       string t =   ;       for (int i = 0; i < s.length(); i++) {         if (s[i] ==  R  && b) {           t +=  P ;           b--;         } else if (s[i] ==  P  && c) {           t +=  S ;           c--;         } else if (s[i] ==  S  && a) {           a--;           t +=  R ;         } else {           t +=  _ ;         }       }       for (int i = 0; i != n; ++i) {         if (t[i] !=  _ ) continue;         if (a) {           t[i] =  R ;           a--;         } else if (b) {           t[i] =  P ;           b--;         } else {           t[i] =  S ;           c--;         }       }       cout << t <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1000 * 100 + 3, inf = 1000 * 1000 * 100;   int n, m, a[MAXN], b[MAXN], t[MAXN], ans = 0, y, z;   int main() {     cin >> n >> m >> y >> z;     for (int i = 0; i < n; i++) cin >> a[i];     b[0] = -inf;     b[m + 1] = inf;     for (int i = 1; i <= m; i++) cin >> b[i];     for (int i = 0; i <= m; i++) t[i] = -1;     for (int i = 0; i < n; i++) {       int ind = lower_bound(b, b + m + 2, a[i]) - b;       int nex = b[ind], prev = b[ind - 1];       if (nex - a[i] < a[i] - prev) {         if (t[ind] != -1) ans++;         t[ind] = nex - a[i];       } else if (nex - a[i] > a[i] - prev) {         if (t[ind - 1] != -1 && t[ind - 1] < a[i] - prev) {           ans++;         } else {           if (t[ind - 1] > a[i] - prev) ans++;           t[ind - 1] = a[i] - prev;         }       } else {         if (t[ind - 1] == -1 || t[ind - 1] == a[i] - prev) {           t[ind - 1] = a[i] - prev;         } else {           t[ind] = nex - a[i];         }       }     }     cout << ans << endl;     return 0;   }
/*    * yaswanth phani kommineni    */   #include <bits/stdc++.h>   using namespace std;   typedef long long int ll;   #define endl   n ;         void solve(){    ll n;    cin >> n;    n*=2;    vector <ll> v(n);    map <ll,ll> m;    for(ll i=0;i<n;i++){     cin >> v[i];     m[v[i]]++;    }    sort(v.begin(),v.end());    for(ll i=0;i<n-1;i++){     auto mp = m;     auto V = v;     vector <pair<ll,ll>> ans;     ans.push_back(make_pair(v[n-1],v[i]));     mp[v[n-1]]--;     mp[v[i]]--;     ll cur = v[n-1];     while(true){      while(!V.empty() && !mp[V.back()]){       V.pop_back();      }      if(V.empty()) break;      ll last = V.back();      mp[last]--;      if(!mp[cur-last]){       break;      }      ans.push_back(make_pair(last,cur-last));      mp[cur-last]--;      cur = last;     }     if((ll)ans.size()==n/2){      cout <<  YES  << endl;      cout << ans.front().first + ans.front().second << endl;      for(auto x : ans){       cout << x.second <<     << x.first << endl;      }      return;     }    }    cout <<  NO  << endl;   }      int main(){    //freopen( input.txt , r ,stdin);    //freopen( output.txt , w ,stdout);    ios_base::sync_with_stdio(false);    cin.tie(0);    cout.tie(0);    int tc;    tc = 1;    cin >> tc;    for(int i=1;i<=tc;i++){     solve();    }    return 0;   }
#include <bits/stdc++.h>   using namespace std;   int toDelete = 0, arr[1500010], N;   int main() {     cin.sync_with_stdio(0);     cin.tie(0);     cin >> N;     for (int i = 0; i < N; ++i) {       int x;       cin >> x;       arr[x]++;     }     int ans = 0;     for (int i = 0; i <= 1500000; ++i) {       int val = arr[i];       int id = i;       arr[i] = 0;       while (val > 0) {         arr[id] += val % 2;         id++;         val /= 2;       }       if (arr[i]) ans++;     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   ostream& operator<<(ostream& out, vector<T>& v) {     out <<  [ ;     for (auto k : v) out << k <<    ;     out <<  ] ;     return out;   }   vector<int> g[500];   string color;   bool posible = true;   void DFS(int n, int p, char c) {     if (color[n] !=  -  && color[n] != c) {       posible = false;       return;     }     if (color[n] !=  - ) return;     color[n] = c;     char nc =  1  - c +  0 ;     for (auto k : g[n])       if (k != p) DFS(k, n, nc);   }   int main() {     int n;     string in;     cin >> n >> in;     color.resize(n,  - );     for (int i = 0; i < int(n); i++) {       for (int j = int(i + 1); j < int(n); j++) {         if (in[i] > in[j]) {           g[i].push_back(j);           g[j].push_back(i);         }       }     }     for (int i = 0; i < int(n); i++)       if (color[i] ==  - ) DFS(i, -1,  0 );     if (posible)       cout <<  YES  << endl << color << endl;     else       cout <<  NO  << endl;   }
#include <bits/stdc++.h>   using namespace std;   vector<vector<pair<int, int> > > v(400005);   int parent[400005], low[400005], disc[400005], TIME;   bool visited[400005], road[400005];   set<int> bridge;   int SIZE;   pair<int, int> EDGE[400005];   void dfs(int a) {     TIME++;     visited[a] = true;     disc[a] = TIME, low[a] = TIME;     for (int i = 0; i < v[a].size(); i++) {       if (!visited[v[a][i].first]) {         parent[v[a][i].first] = a;         dfs(v[a][i].first);         low[a] = min(low[a], low[v[a][i].first]);         if (low[v[a][i].first] > disc[a]) bridge.insert(v[a][i].second);       } else if (v[a][i].first != parent[a])         low[a] = min(low[a], disc[v[a][i].first]);     }   }   void dfs2(int a) {     visited[a] = true;     SIZE++;     for (int i = 0; i < v[a].size(); i++)       if (bridge.count(v[a][i].second) == 0 and !visited[v[a][i].first])         dfs2(v[a][i].first);   }   void solve(int a) {     for (int i = 0; i < v[a].size(); i++) {       if (!road[v[a][i].second]) {         road[v[a][i].second] = true;         if (bridge.count(v[a][i].second) == 0)           EDGE[v[a][i].second] = make_pair(a, v[a][i].first);         else           EDGE[v[a][i].second] = make_pair(v[a][i].first, a);         solve(v[a][i].first);       }     }   }   int main() {     int n, m;     cin >> n >> m;     int MAXSIZE = 0, NODE;     for (int i = 0; i < m; i++) {       int x, y;       scanf( %d %d , &x, &y);       v[x].push_back(make_pair(y, i)), v[y].push_back(make_pair(x, i));     }     dfs(1);     memset(visited, false, sizeof(visited));     for (int i = 0; i < n; i++) {       SIZE = 0;       if (!visited[i + 1]) dfs2(i + 1);       if (SIZE > MAXSIZE) MAXSIZE = SIZE, NODE = i + 1;     }     solve(NODE);     cout << MAXSIZE << endl;     for (int i = 0; i < m; i++)       cout << EDGE[i].first <<     << EDGE[i].second << endl;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   const int INF = 0x3f3f3f3f;   const ll LINF = 0x3f3f3f3f3f3f3f3fLL;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout << setprecision(10) << fixed;     int n, k;     cin >> n >> k;     vector<double> p(n);     for (auto& x : p) cin >> x;     int null = (int)count(begin(p), end(p), 0.0);     if (n - null < k) {       for (int u = 0; u < n; ++u) {         double res = p[u] == 0.0 ? 0.0 : 1.0;         cout << res <<   n ;       }       exit(0);     }     vector<int> popcount(1 << n, 0);     vector<double> sum(1 << n, 0);     for (int u = 0; u < n; ++u) sum[1 << u] = p[u];     for (int mask = 1; mask < (1 << n); ++mask) {       int lsb = mask & -mask;       popcount[mask] = 1 + popcount[mask ^ lsb];       if (mask != lsb) sum[mask] = sum[lsb] + sum[mask ^ lsb];     }     vector<double> dp(1 << n, 0);     dp[0] = 1;     for (int mask = 0; mask < (1 << n); ++mask) {       for (int u = 0; u < n; ++u) {         if ((mask >> u & 1) || p[u] == 0) continue;         int newmask = mask | (1 << u);         dp[newmask] += dp[mask] * p[u] / (1 - sum[mask]);       }     }     for (int u = 0; u < n; ++u) {       double res = 0;       for (int mask = 0; mask < (1 << n); ++mask) {         if (popcount[mask] == k && (mask >> u & 1)) res += dp[mask];       }       cout << res <<   n ;     }     exit(0);   }
#include <bits/stdc++.h>   using namespace std;   int dis[305][305], lca[305], val[305];   int main() {     int n, x;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &x);       lca[x] = i;       val[i] = x;     }     char s[305];     memset(dis, 0, sizeof dis);     for (int i = 1; i <= n; i++) {       scanf( %s , s + 1);       for (int j = 1; j <= n; j++)         if (s[j] ==  1 ) dis[i][j] = dis[j][i] = 1;     }     for (int k = 1; k <= n; k++)       for (int i = 1; i <= n; i++)         for (int j = 1; j <= n; j++)           if (dis[i][j] == 0) dis[i][j] = dis[i][k] & dis[k][j];     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++) {         if (dis[i][lca[j]] == 0) continue;         val[lca[j]] = val[i];         lca[val[i]] = lca[j];         val[i] = j;         lca[j] = i;       }     for (int i = 1; i <= n; i++) printf( %d%s , val[i], i == n ?   n  :    );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 2e3 + 7;   long long read() {     long long res = 0, f = 1;     char c = getchar();     while (!isdigit(c) && c !=  - ) c = getchar();     if (c ==  - ) f = -1, c = getchar();     while (isdigit(c)) res = (res << 1) + (res << 3) + c - 48, c = getchar();     return res * f;   }   long long ans;   int n, m;   long long f[maxn][maxn], g[maxn][maxn];   int main() {     n = read(), m = read();     for (int i = 2; i <= m; i++) f[1][i] = 1;     for (int i = 2; i <= n; i++)       for (int j = 2; j <= m; j++)         f[i][j] = (f[i - 1][j] + 2 * f[i][j - 1] - f[i][j - 2] + 1000000007) %                   1000000007;     for (int i = 1; i <= n; i++)       for (int j = 2; j <= m; j++) g[i][j] = (g[i - 1][j] + f[i][j]) % 1000000007;     for (int i = 1; i <= n; i++)       for (int j = 2; j <= m; j++)         (ans += f[i][j] * g[n - i + 1][j] % 1000000007 * (m - j + 1) %                 1000000007) %= 1000000007;     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n = 0, l = 0, r = 0, x = 0, c[16];     cin >> n >> l >> r >> x;     for (int i = 0; i < n; i++) cin >> c[i];     sort(c, c + n);     int total = 0, cnt = 0, ret = 0, easy = 0, hard = 0;     for (int i = 0; i < (1 << n); i++) {       total = 0, cnt = 0;       for (int j = 0; j < n; j++) {         if ((1 << j) & i) {           if (cnt == 0) {             easy = c[j];           }           total += c[j];           cnt++;           hard = c[j];         }       }       if (cnt > 1 && total >= l && total <= r && hard - easy >= x) {         ret++;       }     }     cout << ret;     return 0;   }
#include <bits/stdc++.h>   char putnb[20];   using namespace std;   const long long mod = 1e9 + 7;   const long long mod2 = 1999999973;   const int infs = 1e8;   const long long inf = 1e18;   const int N = 200000;   long long A[N + 5];   long long dp[N + 5][2];   bool vis[N + 5][2];   bool solved[N + 5][2];   long long n;   long long solve(long long pos, int state) {     if (pos <= 0 || pos > n) return 0;     if (vis[pos][state] && !solved[pos][state]) return -1;     vis[pos][state] = true;     if (pos == 1) {       if (state) return 0 - inf;       return -1;     }     if (solved[pos][state]) return dp[pos][state];     if (!state) {       long long v1 = solve(pos + A[pos], 1);       if (v1 == -1)         dp[pos][state] = -1;       else         dp[pos][state] = v1 + A[pos];     } else {       long long v2 = solve(pos - A[pos], 0);       if (v2 == -1)         dp[pos][state] = -1;       else         dp[pos][state] = v2 + A[pos];     }     solved[pos][state] = true;     return dp[pos][state];   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     ;     cin >> n;     for (int i = 2; i <= n; ++i) cin >> A[i];     for (int i = 1; i <= n - 1; ++i) {       long long res = solve(1 + i, 1);       if (res == -1)         cout << res <<   n ;       else if (res >= 0)         cout << res + i <<   n ;       else if (res < 0)         cout << (res + inf + 2 * i) <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int X = 1e5 + 9;   const long long inf = (1ll << 60);   int n, sum, a[109], b[109], c[109];   int main() {     cin >> n;     for (int i = 0; i < n; i++) {       cin >> a[i];       b[a[i]]++;     }     for (int i = 0; i < n; i++) {       cin >> a[i];       c[a[i]]++;     }     for (int i = 1; i <= 5; i++) {       if ((b[i] + c[i]) % 2 == 1) {         puts( -1 );         return 0;       }     }     for (int i = 1; i <= 5; i++) {       sum += (abs(c[i] - b[i]) / 2);     }     cout << sum / 2 << endl;   }