malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include<bits/stdc++.h>   using namespace std;   #define ll long long   #define pb push_back   #define fi first   #define se second   #define pii pair<int,int>       void solve() {       int n, m;       cin>>n>>m;       vector<int> a(n), b(n), c(m), vis(n, 1);       int cnt = 0;       for(int i=0;i<n;i++) cin>>a[i];       for(int i=0;i<n;i++) {           cin>>b[i];           if(a[i] != b[i]) {               vis[i] = 0;               cnt++;           }                      }       vector<vector<int>> arr(n);       for(int i=0;i<m;i++) {           cin>>c[i];           arr[c[i] - 1].pb(i);       }       if(cnt > m) {           cout<< NO ;           return ;       }       vector<int> ans(m, -1);       for(int i=0;i<n;i++) {           if(a[i] != b[i]) {               if(arr[b[i] - 1].empty()) {                   cout<< NO ;                   return ;               }               else {                   ans[arr[b[i] - 1].back()] = i;                   arr[b[i] - 1].pop_back();                }           }       }       for(int i=0;i<n;i++) {           if(a[i] == b[i]) {               if(!arr[b[i] - 1].empty())  {                   ans[arr[b[i] - 1].back()] = i;                   arr[b[i] - 1].pop_back();                }           }       }       int last = ans[m-1];       for(int i=m-2;i>=0;i--) {           if(last != -1) {               if(ans[i] == -1) {                   ans[i] = last;               }                else last = ans[i];           }           else last = ans[i];       }       for(int i=0;i<m;i++) {           if(ans[i] == -1) {               cout<< NO ;               return ;           }       }       cout<< YES <<  n ;       for(int i=0;i<m;i++) cout<<ans[i] + 1<<   ;    }      int main() {       int t = 1;       cin>>t;       while(t--) {           solve();           cout<<  n ;       }       return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int x0, y0, x[3], y[3], x1[3], y1[3];     for (int i = 0; i < 3; i++) cin >> x[i] >> y[i];     x0 = x[0] - x[1], y0 = y[0] - y[1];     x1[0] = x[2] - x0, y1[0] = y[2] - y0;     x1[1] = x[2] + x0, y1[1] = y[2] + y0;     x0 = x[1] - x[2], y0 = y[1] - y[2];     x1[2] = x[0] - x0, y1[2] = y[0] - y0;     if (x1[2] == x1[0] || x1[2] == x1[1]) x1[2] = x[0] + x0, y1[2] = y[0] + y0;     printf( %d n , 3);     for (int i = 0; i < 3; i++) cout << x1[i] <<     << y1[i] << endl;     return 0;   }
#include  list    #include <iostream>   #include <utility>   #include <vector>   #include  fstream    #include <fstream>   #include <map>   #include  algorithm    #include <iomanip>   #include  cmath    #include  set    #include <climits>   #include  queue    #include  complex       #define all(x) (x).begin(), (x).end()   #define ll long long   using namespace std;   long long mod = 1e9 + 7;   void solve() {       int n, k;       cin >> n >> k;       long long res = 1;       for (int i = 0; i < k; ++i) {           res *= n;           res %= mod;       }       cout << res << endl;   }   signed main() {       int n;       cin >> n;       while (n--) solve();      }
#include <bits/stdc++.h>   using namespace std;   const int MAX_N = 1e6 + 200, RANGE = 1e6 + 20;   const long long INF = 0x3f3f3f3f3f3f3f3f;   int n, m, p;   long long pre_min[MAX_N], nodes[MAX_N << 2], tag[MAX_N << 2];   pair<int, int> ai[MAX_N], bi[MAX_N];   struct tup {     int x, y, z;     bool operator<(const tup &rhs) const {       return x < rhs.x || (x == rhs.x && y < rhs.y);     }   } tups[MAX_N];   void pushdown(int p) {     if (tag[p] != 0) {       tag[(p << 1)] += tag[p], tag[((p << 1) | 1)] += tag[p];       nodes[(p << 1)] += tag[p], nodes[((p << 1) | 1)] += tag[p];       tag[p] = 0;     }   }   void pushup(int p) { nodes[p] = max(nodes[(p << 1)], nodes[((p << 1) | 1)]); }   void update(int ql, int qr, int l, int r, int p, long long val) {     if (ql <= l && r <= qr) return (void)(nodes[p] += val, tag[p] += val);     pushdown(p);     if (ql <= ((l + r) >> 1)) update(ql, qr, l, ((l + r) >> 1), (p << 1), val);     if (((l + r) >> 1) < qr)       update(ql, qr, ((l + r) >> 1) + 1, r, ((p << 1) | 1), val);     pushup(p);   }   int main() {     scanf( %d%d%d , &n, &m, &p);     for (int i = 1; i <= n; i++) scanf( %d%d , &ai[i].first, &ai[i].second);     for (int i = 1; i <= m; i++) scanf( %d%d , &bi[i].first, &bi[i].second);     for (int i = 1; i <= p; i++)       scanf( %d%d%d , &tups[i].x, &tups[i].y, &tups[i].z), tups[i].y++,           tups[i].x++;     sort(ai + 1, ai + 1 + n), sort(bi + 1, bi + 1 + m),         sort(tups + 1, tups + 1 + p);     pre_min[m + 1] = INF;     for (int i = m; i >= 1; i--)       pre_min[i] = min(pre_min[i + 1], 1LL * bi[i].second);     int last_pos = 1;     for (int i = 1; i <= m; i++)       update(last_pos, bi[i].first, 1, RANGE, 1, -pre_min[i]),           last_pos = bi[i].first + 1;     update(last_pos, RANGE, 1, RANGE, 1, -INF);     long long ans = -INF;     for (int i = 1, ptr = 1; i <= n; i++) {       int pos = ai[i].first, cost = ai[i].second;       while (ptr <= p && tups[ptr].x <= pos)         update(tups[ptr].y, RANGE, 1, RANGE, 1, tups[ptr].z), ptr++;       ans = max(ans, nodes[1] - cost);     }     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   #include <unordered_map>   #include <cctype>   #include <string.h>      #define PB push_back   #define EB emplace_back    #define MP make_pair   #define endl   n    #define ll long long   #define ull unsigned long long   #define STR string   #define VEC vector<int>   #define IOS {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}   #define loop(i,a,b,c) for(ll i=a;i<b;i+=c)   #define MOD (int)1000000007   #define sp       #define pii pair<int,int>         using namespace std;   using namespace std::chrono;      /* Debugging */   template <typename T>   void printarr(T *A, int n){     for (int i = 0; i < n; i++)     {       cout<<A[i]<<   ;     }     cout<<endl;     }   template <typename T>   void arrinit(T *A, int n, T data){     for (int i = 0; i < n; i++)     {       A[i] = data;     }        }   template <typename T>   void takeinput(T *A, int n){     for(int i=0;i<n;i++){       cin>>A[i];     }   }   template <typename T>   void printcont(T A){     for(auto a: A){       cout<<a+1<<   ;     }     cout<<endl;   }   template <typename T>   T binpowmod(T a, T b, T p){     if(b==0) return 1;     if(b==1) return a;     if(b%2==0) return ((binpowmod(a,b/2,p)%p)*(binpowmod(a,b/2,p)%p))%p;     return ((a%p)*(binpowmod(a,b-1,p)%p))%p;   }   // template <typename T>   // T gcd(T a,T b){   //   if(a==0) return b;   //   if(b==0) return a;   //   if(a>b) return gcd(b,a%b);   //   return gcd(b%a,a); 1 2 3 4  => 1 2    // }      void solve (){     int n;     cin>>n;     int k = n;     vector <pii> steps{};     if(n<=8){       for (int i = 3; i < n; i++)       {           steps.PB({i,i+1});       }       while(n!=1){           steps.PB({k,2});           if(n%2==1) n = n/2 + 1;           else n/=2;       }       }     else{       for (int i = 3; i < n; i++)       {           if(i!=8)steps.PB({i,i+1});       }       while(n!=1){           steps.PB({k,8});           if(n%8!=0) n = n/8 + 1;           else n = n/8;       }       steps.PB({8,2});       steps.PB({8,2});       steps.PB({8,2});     }     cout<<steps.size()<<endl;     for (int i = 0; i < steps.size(); i++)     {         cout<<steps[i].first<<   <<steps[i].second<<endl;     }             }      int main(){       auto start = high_resolution_clock::now();        IOS       // freopen( input.txt , r ,stdin);       // freopen( output.txt , w ,stdout);       // freopen( output.txt , w ,stderr);       ll t;       cin>>t;         while(t--){         solve();       }       auto stop = high_resolution_clock::now();        auto duration = duration_cast<milliseconds>(stop - start);        // cout << Time taken :  <<duration.count() <<  milliseconds n ;       return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   inline T abs(T a) {     return ((a < 0) ? -a : a);   }   template <typename T>   inline T sqr(T a) {     return a * a;   }   const int INF = (int)1E9 + 7;   const long double EPS = 1E-10;   const long double PI = 3.1415926535897932384626433832795;   int n;   vector<long double> a;   bool check(const vector<long double>& a) {     if (int((a).size()) <= 1) return true;     if (fabs(a[0]) < EPS) {       for (int i = 0; i < int(int((a).size())); ++i)         if (fabs(a[i]) > EPS) return false;       return true;     }     long double b = a[1] / a[0], cur = a[0];     for (int i = 0; i < int(int((a).size())); ++i) {       if (fabs(a[i] - cur) > EPS) return false;       cur *= b;     }     return true;   }   vector<int> getz(const vector<long double>& a) {     vector<int> z(int((a).size()));     int l = 0, r = -1;     for (int i = int(1); i < int(int((a).size())); ++i) {       z[i] = i > r ? 0 : min(z[i - l], r - i + 1);       while (i + z[i] < int((a).size()) && fabs(a[z[i]] - a[i + z[i]]) < EPS)         z[i]++;       if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;     }     return z;   }   int main() {     cin >> n;     a.resize(n);     for (int i = 0; i < int(n); ++i) {       int x;       scanf( %d , &x);       a[i] = x;     }     if (check(a)) {       puts( 0 );       exit(0);     }     for (int i = 0; i < int(2); ++i) {       vector<long double> b = a;       b.erase(b.begin() + i);       if (check(b)) {         puts( 1 );         exit(0);       }     }     vector<long double> ok(n - 1, 0);     if (fabs(a[0]) > EPS) {       long double d = a[1] / a[0];       ok[0] = a[0], ok[1] = a[1];       for (int i = int(2); i < int(int((ok).size())); ++i) ok[i] = ok[i - 1] * d;     }     vector<long double> t1 = ok;     t1.insert(t1.end(), (a).begin(), (a).end());     vector<int> z1 = getz(t1);     reverse((ok).begin(), (ok).end());     reverse((a).begin(), (a).end());     ok.insert(ok.end(), (a).begin(), (a).end());     vector<int> z2 = getz(ok);     if (z1[n - 1] + z2[n - 1] >= n - 1)       puts( 1 );     else       puts( 2 );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void err(istream_iterator<string> it) {}   template <typename T, typename... Args>   void err(istream_iterator<string> it, T a, Args... args) {     cerr << *it <<   =   << a <<   n ;     err(++it, args...);   }   const double PI = acos(-1);   const double eps = (1e-9);   const long long int INF = (1e18);   const int M = (1e9) + 7;   const int N = 2050;   const int K = 5250;   int dp[N][N];   int n, m, k;   vector<pair<int, int> > fire;   int saare[2][N];   int val[2][N];   int last[2][N];   int sz[2];   void compress(int ind, int n) {     vector<pair<int, int> > tp(n);     int i, j, r;     for (i = 0; i < n; i++) tp[i].first = saare[ind][i], tp[i].second = i;     sort(tp.begin(), tp.end());     i = 0, r = 1, j = 0;     while (i < n) {       while (j < n && tp[i].first == tp[j].first)         saare[ind][tp[j].second] = r, j++;       val[ind][r++] = tp[i].first;       if (j < n && tp[i].first + 1 < tp[j].first)         val[ind][r] = tp[i].first + 1, last[ind][r] = tp[j].first - 1, r++;       i = j;     }     sz[ind] = r;     return;   }   int build() {     int i, j, x, y, a, b;     for (i = 0; i < sz[0]; ++i) {       for (j = 0; j < sz[1]; ++j) dp[i][j] = 0;     }     for (i = 0; i < k; ++i) {       x = saare[0][i], y = saare[1][i];       a = saare[0][i + k], b = saare[1][i + k];       dp[x][y] += 1;       dp[x][b + 1] -= 1;       dp[a + 1][y] -= 1;       dp[a + 1][b + 1] += 1;     }     for (i = 1; i < sz[0]; ++i) {       for (j = 1; j < sz[1]; ++j)         dp[i][j] += (dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1]);     }     x = n + 1, a = 0;     y = m + 1, b = 0;     for (i = 1; i < sz[0]; ++i) {       for (j = 1; j < sz[1]; ++j) {         if (dp[i][j] == 0) {           x = min(x, val[0][i]);           a = max(a, val[0][i]);           a = max(a, last[0][i]);           y = min(y, val[1][j]);           b = max(b, val[1][j]);           b = max(b, last[1][j]);         }       }     }     int z = max(0, max(a - x, b - y));     return z;   }   int check(int t) {     vector<pair<int, int> > point(2 * k);     int i, x, y, a, b;     for (i = 0; i < k; ++i) {       tie(x, y) = fire[i];       a = max(x - t, 1), b = max(y - t, 1);       point[i] = {a, b};       a = min(x + t, n), b = min(y + t, m);       point[i + k] = {a, b};     }     for (i = 0; i < 2 * k; ++i) tie(saare[0][i], saare[1][i]) = point[i];     int s = 2 * k;     saare[0][s] = 1, saare[1][s] = 1, s++;     saare[0][s] = n, saare[1][s] = m, s++;     compress(0, s);     compress(1, s);     {       string _s =  t ;       replace(_s.begin(), _s.end(),  , ,    );       stringstream _ss(_s);       istream_iterator<string> _it(_ss);       err(_it, t);     };     int z = build();     return (z <= 2 * t);   }   void solve() {     scanf( %d%d%d , &n, &m, &k);     fire.resize(k);     int i;     for (i = 0; i < k; ++i) scanf( %d%d , &fire[i].first, &fire[i].second);     int mid, l = 0, r = (max(n, m) / 2);     while (l < r) {       mid = ((l + r) >> 1);       if (check(mid))         r = mid;       else         l = mid + 1;     }     printf( %d n , l);   }   int main() {     int t;     t = 1;     while (t--) solve();   }
#include <bits/stdc++.h>   using namespace std;   vector<string> str;   const string di =  .. ;   char ss[500];   int main() {     int ti;     scanf( %d , &ti);     for (int i = 0; i < ti; i++) {       scanf( %s , ss);       if (ss[0] ==  p ) {         printf( / );         for (int i = 0; i < str.size(); i++) printf( %s/ , str[i].c_str());         printf(  n );       } else {         scanf( %s , ss);         if (ss[0] ==  / ) str.clear();         char *tmp = strtok(ss,  / );         while (tmp != NULL) {           if (di == tmp)             str.pop_back();           else             str.push_back(tmp);           tmp = strtok(NULL,  / );         }       }     }   }
#include <bits/stdc++.h>   using namespace std;   const long long MOD = 100000000;   const long long MAXN = 2e6 + 20;   struct edge {     long long from, to, cost;   };   int main() {     long long i, j, k, t1, t2, t3, n, m, t;     std::ios::sync_with_stdio(0);     cin >> n >> k;     cout << (k + n - 1) / n <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int i, j, n, a[5002], b, c, d;     cin >> n;     cout <<  ?  <<     << 1 <<     << 2 << endl;     fflush(stdout);     cin >> b;     cout <<  ?  <<     << 2 <<     << 3 << endl;     fflush(stdout);     cin >> c;     cout <<  ?  <<     << 1 <<     << 3 << endl;     fflush(stdout);     cin >> d;     a[1] = (b + d - c) / 2;     a[2] = b - a[1];     a[3] = d - a[1];     for (i = 4; i <= n; i++) {       cout <<  ?  <<     << 1 <<     << i << endl;       fflush(stdout);       cin >> b;       a[i] = b - a[1];     }     cout <<  !  <<    ;     for (i = 1; i <= n; i++) cout << a[i] <<    ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool Notlucky(int x) {     for (int i = x; i != 0; i /= 10) {       if (i % 10 == 8 || i % 10 == -8) return false;     }     return true;   }   int main() {     int a, b;     cin >> a;     b = a + 1;     while (Notlucky(b)) {       b++;     }     cout << b - a;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void __print(int x) { cerr << x; }   void __print(long x) { cerr << x; }   void __print(long long x) { cerr << x; }   void __print(unsigned x) { cerr << x; }   void __print(unsigned long x) { cerr << x; }   void __print(unsigned long long x) { cerr << x; }   void __print(float x) { cerr << x; }   void __print(double x) { cerr << x; }   void __print(long double x) { cerr << x; }   void __print(char x) { cerr <<      << x <<     ; }   void __print(const char *x) { cerr <<     << x <<    ; }   void __print(const string &x) { cerr <<     << x <<    ; }   void __print(bool x) { cerr << (x ?  true  :  false ); }   template <typename T, typename V>   void __print(const pair<T, V> &x) {     cerr <<  { ;     __print(x.first);     cerr <<  , ;     __print(x.second);     cerr <<  } ;   }   template <typename T>   void __print(const T &x) {     int f = 0;     cerr <<  { ;     for (auto &i : x) cerr << (f++ ?  ,  :   ), __print(i);     cerr <<  } ;   }   void _print() { cerr <<  ] n ; }   template <typename T, typename... V>   void _print(T t, V... v) {     __print(t);     if (sizeof...(v)) cerr <<  ,  ;     _print(v...);   }   mt19937_64 rnd;   const int N = 2e5 + 5;   void tc() {     int n;     cin >> n;     vector<int> v;     int p = 1;     while (n) {       if (n % 10) {         v.push_back(n % 10 * p);       }       n /= 10;       p *= 10;     }     cout << int((v).size()) <<   n ;     for (auto x : v) cout << x <<    ;     cout <<   n ;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     int t;     cin >> t;     while (t--) tc();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX_N = (int)1e5 + 20;   long long a[MAX_N];   long long dp[2][MAX_N][2];   int n;   long long ans;   void Solve(int p) {     dp[p][0][0] = 0, dp[p][0][1] = -1;     for (int i = 1; i < n; i++) {       int bri = i - 1;       long long m = a[bri];       if (m <= 1)         dp[p][i][0] = -1;       else {         long long res = (m / 2) * 2;         if (dp[p][i - 1][0] != -1) res += dp[p][i - 1][0];         dp[p][i][0] = res;       }       if (m < 1)         dp[p][i][1] = -1;       else {         long long ret = ((m - 1) / 2) * 2 + 1;         if (max(dp[p][i - 1][0], dp[p][i - 1][1]) != -1)           ret += max(dp[p][i - 1][0], dp[p][i - 1][1]);         dp[p][i][1] = ret;       }     }   }   int main() {     cin >> n;     for (int i = 0; i < n - 1; i++) cin >> a[i];     Solve(0);     reverse(a, a + n - 1);     Solve(1);     for (int i = 0; i < n; i++) {       long long res, ted, ret;       res = ted = ret = 0;       if (dp[0][i][0] != -1 && dp[1][n - (i + 1)][1] != -1)         res = dp[0][i][0] + dp[1][n - (i + 1)][1];       if (dp[0][i][1] != -1 && dp[1][n - (i + 1)][0] != -1)         ted = dp[0][i][1] + dp[1][n - (i + 1)][0];       if (dp[0][i][0] != -1 && dp[1][n - (i + 1)][0] != -1)         ret = dp[0][i][0] + dp[1][n - (i + 1)][0];       ans = max(ans, max(ret, max(res, ted)));     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, k, ans;     cin >> n >> k;     if (n % 2 == 0) {       if (k <= n / 2) {         ans = 2 * k - 1;       } else {         ans = 2 * k - n;       }     } else {       if (k <= (n / 2) + 1) {         ans = 2 * k - 1;       } else {         ans = 2 * k - n - 1;       }     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<pair<int, int> > a[60];   int c[60], d[60], e[60];   int main() {     int i, j, k, m, n;     double w;     while (scanf( %d%lf%d , &n, &w, &m) != EOF) {       for (i = 0; i < n; i++) d[i] = m;       memset(c, 0, sizeof(c));       k = 0;       int f = 0;       for (i = 0; i < m; i++) a[i].clear();       for (i = 0; i < n; i++) {         int cnt = 0;         while (d[i] > 0) {           if (d[i] >= n - c[k]) {             a[k].push_back(make_pair(i, n - c[k]));             d[i] -= n - c[k];             c[k] = n;             k++;           } else {             a[k].push_back(make_pair(i, d[i]));             c[k] += d[i];             d[i] = 0;           }           cnt++;         }         if (cnt > 2) f = 1;       }       if (f) {         puts( NO );         continue;       }       puts( YES );       for (i = 0; i < m; i++) {         for (j = 0; j < a[i].size(); j++) {           printf( %d %.10lf%c , a[i][j].first + 1, a[i][j].second * w / m,                  j < a[i].size() - 1 ?     :   n );         }       }     }   }
#include <bits/stdc++.h>   using namespace std;   long long N, i, j, k, a, b;   long long gcd(long long a, long long b) {     long long t;     while (b > 0) {       t = b;       b = a % b;       a = t;     }     return a;   }   long long lcm(long long a, long long b, long long c) {     long long d = a * b / gcd(a, b);     return c * d / gcd(c, d);   }   int main() {     scanf( %I64d , &N);     for (i = max(1ll, N - 100); i <= N; i++) {       for (j = i; j <= N; j++) {         for (k = j; k <= N; k++) {           b = lcm(i, j, k);           if (b > a) a = b;         }       }     }     printf( %I64d n , a);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 + 5;   const int INF = 0x3f3f3f3f;   int vis[105];   int main() {     string s;     cin >> s;     int len = s.size();     int ans = 0;     for (int i = 0; i < len - 1; i++) {       if (s[i] ==  V  && s[i + 1] ==  K ) ans++;     }     for (int i = 0; i < len; i++) {       char ch = s[i];       s[i] =  V ;       int temp = 0;       for (int j = 0; j < len - 1; j++) {         if (s[j] ==  V  && s[j + 1] ==  K ) temp++;       }       s[i] = ch;       ans = max(ans, temp);     }     for (int i = 0; i < len; i++) {       char ch = s[i];       s[i] =  K ;       int temp = 0;       for (int j = 0; j < len - 1; j++) {         if (s[j] ==  V  && s[j + 1] ==  K ) temp++;       }       s[i] = ch;       ans = max(ans, temp);     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int m, n, q, a[13][110005], id;   bitset<4100> s[110005];   inline int read() {     int ret = 0, ff = 1;     char ch = getchar();     while (!isdigit(ch)) {       if (ch ==  - ) ff = -1;       ch = getchar();     }     while (isdigit(ch)) {       ret = (ret << 3) + (ret << 1) + (ch ^ 48);       ch = getchar();     }     return ret * ff;   }   signed main() {     m = read(), n = read(), q = read();     id = n;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) a[i][j] = read();       for (int j = 0; j < (1 << n); j++)         if (j & (1 << (i - 1))) s[i][j] = 1;     }     for (int que = 1; que <= q; que++) {       int opt = read(), x = read(), y = read();       if (opt == 1) {         s[++id] = s[x] & s[y];         continue;       }       if (opt == 2) {         s[++id] = s[x] | s[y];         continue;       }       if (opt == 3) {         vector<pair<int, int> > v;         for (int i = 1; i <= n; i++) v.push_back(make_pair(a[i][y], i));         sort(v.begin(), v.end());         int sum = 0;         for (int i = 0; i < n; i++) {           sum |= (1 << (v[i].second - 1));           if (s[x][sum]) {             printf( %d n , v[i].first);             break;           }         }         continue;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void read(vector<long long int> &a, int n) {     a.resize(n);     for (int i = 0; i < n; i++) cin >> a[i];   }   bool fine = 0;   void solve() {     int x, y, z;     cin >> x >> y >> z;     vector<int> a(x), b(y), c(z);     for (int i = 0; i < x; i++) cin >> a[i];     for (int i = 0; i < y; i++) cin >> b[i];     for (int i = 0; i < z; i++) cin >> c[i];     sort(a.begin(), a.end());     sort(b.begin(), b.end());     sort(c.begin(), c.end());     reverse(a.begin(), a.end());     reverse(c.begin(), c.end());     reverse(b.begin(), b.end());     long long int ans = 0;     long long int dp[x + 1][y + 1][z + 1];     memset(dp, 0, sizeof(dp));     for (int i = 0; i < x + 1; i++) {       for (int j = 0; j < y + 1; j++) {         for (int k = 0; k < z + 1; k++) {           if ((i + j + k) < 2 || (i + j + k) & 1) continue;           if (i && j)             dp[i][j][k] =                 max(dp[i][j][k], dp[i - 1][j - 1][k] + a[i - 1] * b[j - 1]);           if (i && k)             dp[i][j][k] =                 max(dp[i][j][k], dp[i - 1][j][k - 1] + a[i - 1] * c[k - 1]);           if (k && j)             dp[i][j][k] =                 max(dp[i][j][k], dp[i][j - 1][k - 1] + b[j - 1] * c[k - 1]);           ans = max(dp[i][j][k], ans);         }       }     }     cout << ans << endl;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     if (fine) {       int t;       cin >> t;       while (t--) {         solve();       }     } else       solve();     return 0;   }