malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n >> m;     int a[n + 2][m + 2];     int counter = 1;     for (int i = 1; i <= n; i += 2) {       for (int j = 1; j <= m; j++) {         if (n % 2 && i == n && j % 2 == 1) continue;         a[i + (j % 2 == 1)][j] = counter;         counter++;       }     }     for (int i = 1; i <= n; i += 2) {       for (int j = 1; j <= m; j++) {         if (n % 2 && i == n && j % 2 == 0) continue;         a[i + (j % 2 == 0)][j] = counter;         counter++;       }     }     bool res = true;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         if ((i < n && abs(a[i][j] - a[i + 1][j]) <= 1) ||             (j < m && abs(a[i][j] - a[i][j + 1]) <= 1))           res = false;       }     }     if (res) {       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= m; j++) {           cout << a[i][j] <<    ;         }         cout <<   n ;       }     } else {       cout << -1;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int minutes[n];     int result = -1;     int lastN = 0;     for (int i = 0; i < n; i++) {       cin >> minutes[i];       if (i == 0 && minutes[0] > 15) {         result = 15;       } else if (result < 0 && minutes[i] - minutes[i - 1] > 15) {         result = minutes[i - 1] + 15;       }     }     if (result < 0) {       result = minutes[n - 1] + 15;     }     if (result > 90) {       result = 90;     }     cout << result;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int k;     cin >> k;     if (k % 2 == 1) {       cout << -1 << endl;       return 0;     }     for (int i = 0; i < k; i++) {       if (i > 0) cout << endl;       for (int j = 0; j < k; j++) {         for (int l = 0; l < k; l++) {           int layer = min(j, min(l, min(k - j - 1, k - l - 1)));           if (layer % 2 == i % 2)             cout <<  w ;           else             cout <<  b ;         }         cout << endl;       }     }     return 0;   }
#include <bits/stdc++.h>      using namespace std;         void dfs3(int v, vector<vector<int>> &graf, vector<int> &ways) {       ways[v] = -1;       for (auto el : graf[v]) {           if (ways[el] != -1) {               dfs3(el, graf, ways);           }       }   }      void dfs2(int v, vector<vector<int>> &graf,  vector<int> &ways) {       ways[v] = 2;       for (auto el : graf[v]) {           if (ways[el] == 1) {               dfs2(el, graf, ways);           }       }   }      void dfs(int v, vector<int> &vis, vector<int> &cycle, vector<vector<int>> &graf,  vector<int> &ways, vector<int> &progr) {       if (progr[v] == 1) {           cycle.push_back(v);           ways[v] = -1;       } else if (progr[v] == 2) {           vis.push_back(v);           ways[v] = 2;       } else {           progr[v] = 1;           for (auto el : graf[v]) {               dfs(el, vis, cycle, graf, ways, progr);           }           progr[v] = 2;           ways[v] = 1;       }   }      int main()   {       ios::sync_with_stdio(false);       int t;       cin >> t;       while (t--) {           int n, m;           cin >> n >> m;           if (m == 0) {               cout << 1 <<    ;               for (int i = 1; i != n; i++) {                   cout << 0 <<    ;               }           } else {               vector<vector<int>> graf(n);               vector<int> ways(n, 0);               vector<int> progr(n, 0);               // 1 - in progress, 0 - new, 2 - visited               vector<int> cycle;               vector<int> vis;               for (int i = 0; i != m; i++) {                   int s, f;                   cin >> s >> f;                   graf[s - 1].push_back(f - 1);               }               dfs(0, vis, cycle, graf, ways, progr);               for (auto el : vis) {                   dfs2(el, graf, ways);               }               for (auto el : cycle) {                   dfs3(el, graf, ways);               }               for (auto el : ways) {                   cout << el <<    ;               }           }           cout <<   n ;       }       return 0;   }
#include <bits/stdc++.h>   int main() {     long long int l1, r1, l2, r2, k, l, r, t;     scanf( %lld%lld%lld%lld%lld , &l1, &r1, &l2, &r2, &k);     if (l1 > l2)       l = l1;     else       l = l2;     if (r1 > r2)       r = r2;     else       r = r1;     if ((k >= l) && (k <= r))       t = r - l;     else       t = r - l + 1;     if (t < 0)       t = 0;     else       t = t;     printf( %lld , t);     return 0;   }
#include <bits/stdc++.h>   const int md = 1e9 + 7;   int n, k, m, M, c;   struct mat {     int A[256][256];     inline mat() { memset(A, 0, sizeof A); }     inline int* operator[](const int& x) { return A[x]; }     inline mat operator*(const mat& b) const {       mat c;       for (int i = 0; i <= M; ++i)         for (int k = 0; k <= M; ++k)           for (int j = 0; j <= M; ++j)             c[i][j] = (c[i][j] + (long long)A[i][k] * b.A[k][j]) % md;       return c;     }   } A, B;   inline void pow(mat a, int b) {     mat& ret = B;     ret[0][0] = 1;     for (; b; b >>= 1, a = a * a)       if (b & 1) ret = ret * a;   }   int main() {     scanf( %d%d%d , &n, &k, &m), M = (k + 1) << m, c = (1 << m) - 1;     for (int i = 0; i <= k; ++i) {       for (int j = 0; j <= c; ++j) A[i << m | j][i << m | ((j << 1) & c)] = 1;       if (i != k)         for (int j = 0; j <= c; ++j)           A[i << m | j][(i + 1) << m | ((j << 1 | 1) & c)] =               1 + __builtin_popcount(j);     }     pow(A, n);     int ans = 0;     for (int i = 0; i <= c; ++i) ans = (ans + B[0][k << m | i]) % md;     printf( %d , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int t_1 = -1, t_2 = -1;     int c1 = 0, c2 = 0;     int a = 0;     for (int i = 0; i < n; ++i) {       int t;       cin >> t;       if (t_1 == -1) {         t_1 = t;         c1++;       } else if (t_1 == t) {         c1++;       } else if (t_2 == -1) {         t_2 = t;         c2++;       } else if (t_2 == t) {         c2++;       } else {         a = -1;       }     }     if (n % 2 == 1) a = -1;     if (c1 != c2) a = -1;     if (a == -1)       cout <<  NO  << endl;     else       cout <<  YES n  << t_1 <<     << t_2 << endl;     return 0;   }
#include <bits/stdc++.h>   using std::cerr;   using std::endl;   const int N = 2e5 + 233;   int n, m;   std::map<std::pair<int, int>, int> map;   std::vector<std::pair<int, int>> seg[N * 4];   void insert(int p, int l, int r, std::pair<int, int> e, int L, int R) {     if (l <= L && r >= R) return seg[p].push_back(e), void();     if (l <= ((L + R) >> 1)) insert((p << 1), l, r, e, L, ((L + R) >> 1));     if (r > ((L + R) >> 1))       insert(((p << 1) | 1), l, r, e, ((L + R) >> 1) + 1, R);   }   int fa[N], size[N], dis[N];   int find(int x) { return x == fa[x] ? x : find(fa[x]); }   inline int get_dis(int x) {     int ret = 0;     while (x != fa[x]) {       ret ^= dis[x];       x = fa[x];     }     return ret;   }   struct Node {     int x, y, s;   } stk[N];   int top;   void divide(int p, int L, int R, int ok) {     int top_ver = top;     for (auto e : seg[p]) {       int x = e.first, y = e.second;       int u = find(x), v = find(y);       int dis_x = get_dis(x), dis_y = get_dis(y);       if (u != v) {         if (size[u] < size[v]) std::swap(u, v);         stk[++top] = {u, v, size[v]};         fa[u] = v, size[v] += size[u];         dis[u] = dis_x ^ dis_y ^ 1;       } else {         if ((dis_x ^ dis_y) == 0) {           ok = 0;           break;         }       }     }     if (!ok) {       for (int i = L; i <= R; ++i) puts( NO );     } else if (L == R) {       puts( YES );     } else {       divide((p << 1), L, ((L + R) >> 1), ok);       divide(((p << 1) | 1), ((L + R) >> 1) + 1, R, ok);     }     while (top > top_ver) {       int x = stk[top].x, y = stk[top].y, s = stk[top].s;       fa[x] = x, size[y] = s, dis[x] = 0;       --top;     }   }   int main() {     scanf( %d %d , &n, &m);     for (int i = 1; i <= m; ++i) {       int x, y;       scanf( %d %d , &x, &y);       if (x > y) std::swap(x, y);       std::pair<int, int> pair = {x, y};       if (map.find(pair) != map.end()) {         insert(1, map[pair], i - 1, pair, 1, m);         map.erase(pair);       } else {         map[pair] = i;       }     }     for (auto w : map) {       insert(1, w.second, m, w.first, 1, m);     }     for (int i = 1; i <= n; ++i) fa[i] = i, size[i] = 1;     divide(1, 1, m, 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, q, x;     vector<int> v;     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> x;       v.push_back(x);     }     sort(v.begin(), v.end());     cin >> q;     while (q--) {       cin >> x;       int ans = upper_bound(v.begin(), v.end(), x) - v.begin();       cout << ans << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   int p[100001], w[100001];   bool combine(int x, int y) {     while (p[x] != x) x = p[x] = p[p[x]];     while (p[y] != y) y = p[y] = p[p[y]];     if (x == y) return false;     if (w[x] < w[y])       w[p[x] = y] += w[x];     else       w[p[y] = x] += w[y];     return true;   }   int main() {     int n, m, x, y, ans = 1;     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) w[p[i] = i] = 1;     while (m--) {       scanf( %d%d , &x, &y);       if (!combine(x, y)) ans = ans * 2 % 1000000009;       printf( %d n , (ans + 1000000008) % 1000000009);     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int a, b, c, x, y, z;     cin >> a >> b >> c >> x >> y >> z;     int ans;     if ((a == 0 && b == 0 && c) || (x == 0 && y == 0 && z)) {       ans = 0;     } else if (a * y == b * x) {       if (a * z == c * x && b * z == c * y) {         ans = -1;       } else {         ans = 0;       }     } else {       ans = 1;     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 21;   string s;   long long heavy = 0, sol = 0;   int main() {     cin >> s;     for (int i = 0; i < s.size(); i++) {       string temp = s.substr(i, 5);       if (temp ==  heavy ) {         heavy++;         i += 4;       } else if (temp ==  metal ) {         sol += heavy;         i += 4;       }     }     printf( %I64d , sol);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline void chmax(T &x, T &y) {     if (x < y) swap(x, y);   }   template <class T>   inline void chmin(T &x, T &y) {     if (x > y) swap(x, y);   }   const long long INF = 0x3f3f3f3f3f3f;   const long long MOD = 1e9 + 7;   const double EPS = 10e-10;   const long long P2LIM = (long long)2e18;   const long long maxN = 1e9 + 10;   void Solution() {}   long long countSC(long long N) {     long long res =         (long long)sqrt(N) + (long long)cbrt(N) - (long long)(sqrt(cbrt(N)));     return res;   }   int32_t main() {     long long tc;     cin >> tc;     while (tc--) {       long long n;       cin >> n;       cout << countSC(n) <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, tmp;   map<long long, int> b;   long long j = 1, c[33];   void make_two_pow() {     long long i = 2;     while (j <= 32) {       c[j++] = i;       i *= 2;     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);     cin >> n;     for (int i = 0; i < n; i++) {       cin >> tmp;       b[tmp]++;     }     make_two_pow();     long long ans = 0;     for (auto& v : b) {       bool flag = false;       for (int i = 1; i < 33; i++) {         tmp = b.count(c[i] - v.first);         if (tmp) {           if (b[c[i] - v.first] >= 2) {             flag = true;             break;           }           if (c[i] - v.first != v.first) {             flag = true;             break;           }         }       }       if (!flag) {         ans += b[v.first];       }     }     cout << endl << ans << endl;     return 0;   }
#include <bits/stdc++.h>   int nextInt() {     int x;     scanf( %d , &x);     return x;   }   double nextDouble() {     double x;     scanf( %lf , &x);     return x;   }   long long nextLong() {     long long x;     scanf( %I64d , &x);     return x;   }   char nextChar() {     char x;     scanf( %c , &x);     return x;   }   void newLine() { printf(  n ); }   long long powM(long long a, long long b, long long MOD) {     long long x = 1, y = a;     while (b > 0) {       if (b % 2 == 1) {         x = (x * y);         if (x > MOD) x %= MOD;       }       y = (y * y);       if (y > MOD) y %= MOD;       b /= 2;     }     return x;   }   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }   int countSetBits(long long n) {     int ans = 0;     while (n != 0) {       n -= (n & -n);       ++ans;     }     return ans;   }   long long mod = 1000000007;   long long mod2 = 1000000009;   const int N = 1100;   const int M = 111;   const int LOG = 21;   const long long INF = 1e18;   const long double EPS = 1e-6;   const long double PI = 2 * acos(0);   using namespace std;   int a[N], b[N];   int main() {     int n = nextInt();     int m = nextInt();     int d = 0;     bool ok = true;     for (int i = 0; i < m; i++) {       int x = nextInt(), y = nextInt();       a[x] += 1;       a[y + 1] -= 1;     }     for (int i = 1; i <= n; i++) a[i] += a[i - 1];     for (int i = 1; i <= n; i++) {       if (a[i] != 1) {         cout << i <<     << a[i] << endl;         ok = false;         break;       }     }     if (ok) puts( OK );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int qtable[9][9];   int x_min[9];   int x_max[9];   int y_min[9];   int y_max[9];   int solve_problem() {     int n, m, k, s;     if (scanf( %d %d %d %d , &n, &m, &k, &s) != 4) return 1;     fill(x_min, x_min + k, numeric_limits<int>::max());     fill(x_max, x_max + k, numeric_limits<int>::min());     fill(y_min, y_min + k, numeric_limits<int>::max());     fill(y_max, y_max + k, numeric_limits<int>::min());     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++) {         int t;         scanf( %d , &t);         --t;         int x = i + j;         int y = i - j;         if (x < x_min[t]) x_min[t] = x;         if (x > x_max[t]) x_max[t] = x;         if (y < y_min[t]) y_min[t] = y;         if (y > y_max[t]) y_max[t] = y;       }     int prev_q = -1;     for (int i = 0; i < s; i++) {       int q;       scanf( %d , &q);       --q;       if (i > 0) qtable[min(prev_q, q)][max(prev_q, q)] = 1;       prev_q = q;     }     int result = 0;     for (int i = 0; i < k; i++)       for (int j = i; j < k; j++)         if (qtable[i][j]) {           int cand = abs(x_min[i] - x_max[j]);           if (cand > result) result = cand;           cand = abs(x_max[i] - x_min[j]);           if (cand > result) result = cand;           cand = abs(y_min[i] - y_max[j]);           if (cand > result) result = cand;           cand = abs(y_max[i] - y_min[j]);           if (cand > result) result = cand;         }     printf( %d n , result);     return 0;   }   int main() {     solve_problem();     return 0;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:66777216 )   using namespace std;   void sIO();   void iIO();   void fIO(string fn);   const long long INF = 1000000003LL;   const long long BI = (long long)1e18;   int n;   long long c, a[1111], b[1111], lg, l, r, m;   long long check(long long x) {     long long ret = 0, cur;     for (int i = 0; i < n; ++i) {       cur = a[i] * x;       if (cur > INF || cur < 0) return INF;       ret += a[i] * x / b[i] + 1;     }     return min(ret, INF);   }   int main() {     sIO();     scanf( %d %I64d , &n, &c);     for (int i = 0; i < n; ++i) scanf( %I64d %I64d , a + i, b + i);     if (check(BI) == c) {       printf( -1 );       ;       return 0;     }     l = 1;     r = BI;     while (r - l > 1) {       m = (l + r) >> 1;       if (check(m) < c)         l = m;       else         r = m;     }     if (check(l) < c) ++l;     if (check(l) != c) {       printf( 0 );       return 0;     }     lg = l;     l = 1;     r = BI;     while (r - l > 1) {       m = (l + r) >> 1;       if (check(m) > c)         r = m;       else         l = m;     }     printf( %I64d , r - lg);     return 0;   }   inline void sIO() {}   inline void iIO() {     freopen( input.txt ,  r , stdin);     freopen( output.txt ,  w , stdout);   }   inline void fIO(string fn) {     freopen((fn +  .in ).c_str(),  r , stdin);     freopen((fn +  .out ).c_str(),  w , stdout);   }
#include <bits/stdc++.h>   using namespace std;   int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};   int dy8[] = {1, -1, 1, -1, 0, 0, -1, 1};   const double PI = acos(-1.0);   const double EPS = 1e-6;   const int MOD = (int)1e9 + 7;   const int maxn = (int)2e5 + 5;   int cnt[maxn];   int main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     cout.tie(NULL);     int n, m, i, j;     cin >> n >> m;     set<int> s;     for (i = 1; i <= (m); i++) {       int x;       cin >> x;       cnt[x]++;       s.insert(x);       if ((int)s.size() == n) {         cout <<  1 ;         for (j = 1; j <= (n); j++) {           cnt[j]--;           if (cnt[j] == 0) s.erase(j);         }       } else         cout <<  0 ;     }   }
#include <bits/stdc++.h>   const int INF = 0x3f3f3f3f;   using namespace std;   const int N = 255;   int t, n, m, k;   char s[N][N];   int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1};   int dy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};   void dfs(int x, int y) {     s[x][y] =  ! ;     k++;     for (int i = 0; i <= 7; i++) {       int xx = x + dx[i];       int yy = y + dy[i];       if (xx > 0 && xx <= n && yy > 0 && yy <= m && s[xx][yy] ==  1 ) dfs(xx, yy);     }   }   int check1(int x, int y) {     int l = 0, r = 0, u = 0, d = 0;     while (y + 1 <= m && s[x][y + 1] ==  1 ) u++, y++;     while (x + 1 <= n && s[x + 1][y] ==  1 ) r++, x++;     while (y - 1 >= 1 && s[x][y - 1] ==  1 ) d++, y--;     while (x - 1 >= 1 && s[x - 1][y] ==  1 ) l++, x--;     if (u == d && l == r && u == l) return u;     return 0;   }   int check2(int x, int y) {     int l = 0, r = 0, u = 0, d = 0;     while (x + 1 <= n && y - 1 >= 1 && s[x + 1][y - 1] ==  1 ) x++, y--, u++;     while (x + 1 <= n && y + 1 <= m && s[x + 1][y + 1] ==  1 ) x++, y++, l++;     while (x - 1 >= 1 && y + 1 <= m && s[x - 1][y + 1] ==  1 ) x--, y++, d++;     while (x - 1 >= 1 && y - 1 >= 1 && s[x - 1][y - 1] ==  1 ) x--, y--, r++;     if (u == d && l == r && u == l) return u;     return 0;   }   int main() {     (ios::sync_with_stdio(false), cin.tie(0), cout.tie(0));     cin >> t;     while (t--) {       cin >> n >> m;       for (int i = 1; i <= n; i++)         for (int j = 1; j <= m; j++) cin >> s[i][j];       int ans = 0;       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= m; j++) {           if (s[i][j] ==  1 ) {             int c1 = check1(i, j);             int c2 = check2(i, j);             k = 0;             dfs(i, j);             if (k == 4 * c1 || k == 4 * c2) ans++;           }         }       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long two(int x) { return 1LL << x; }   int get(long long p, int i) { return (p >> (i - 1)) & 1; }   long long count(int n, int k, long long pre) {     long long ret = 0;     bool rev = true, inv = true;     for (int i = 1; i + i <= n; i++) {       if (i <= k && n - i + 1 <= k && get(pre, i) != get(pre, n - i + 1))         rev = false;       if (rev)         if (n - 2 * i == 0)           ret += two(max(0, i - k));         else if (n - 2 * i == 1)           ret += two(max(0, i + 1 - k));         else if ((i >= k || !get(pre, i + 1)) &&                  (n - i - 1 >= k || get(pre, n - i)))           ret += two(max(0, n - i - 1 - k - (k <= i)));       if (i <= k && n - i + 1 <= k && get(pre, i) == get(pre, n - i + 1))         inv = false;       if (inv)         if (n - 2 * i == 0)           ret += two(max(0, i - k));         else if (n - 2 * i == 1) {           if (i >= k || !get(pre, i + 1)) ret += two(max(0, i - k));         } else if ((i >= k || !get(pre, i + 1)) &&                    (n - i - 1 >= k || !get(pre, n - i)))           ret += two(max(0, n - i - 1 - k - (k <= i)));     }     return ret;   }   int main() {     int n;     long long m;     cin >> n >> m;     if (m >= count(n, 1, 0LL)) {       cout << -1 << endl;       return 0;     }     long long pre = 0;     for (int i = 2; i <= n; i++) {       long long tmp = count(n, i, pre);       if (m >= tmp) {         m -= tmp;         pre += two(i - 1);       }     }     for (int i = 1; i <= n; i++) cout << get(pre, i);     cout << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int N = (int)2e5 + 50, LOGN = 17;   const int INF = (int)1e9;   int n, k;   int ord[N], in[N], tim = 0;   char las[N];   int lc[N], rc[N];   int res[N];   string str;   void dfs(int v) {     if (lc[v] != -1) dfs(lc[v]);     ord[tim] = v;     in[v] = tim++;     if (rc[v] != -1) dfs(rc[v]);   }   void solve(int v, int& rem) {     int la = -1;     int cur = v;     for (int i = 0; i < (rem); ++i) {       if (cur == -1) break;       if (las[cur] !=     && las[cur] > str[cur]) {         la = i;       }       cur = lc[cur];     }     cur = v;     vector<int> vs;     for (int i = 0; i < (la + 1); ++i) {       res[cur] = 1;       rem--;       vs.push_back(cur);       cur = lc[cur];     }     while (!vs.empty()) {       if (rc[vs.back()] != -1) solve(rc[vs.back()], rem);       vs.pop_back();     }   }   void print_ans(int v) {     if (lc[v] != -1) print_ans(lc[v]);     cout << str[v];     if (res[v]) cout << str[v];     if (rc[v] != -1) print_ans(rc[v]);   }   int pos[256];   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cin >> n >> k;     cin >> str;     for (int i = 0; i < (n); ++i) {       cin >> lc[i] >> rc[i];       lc[i]--, rc[i]--;     }     dfs(0);     fill(pos, pos + 256, INF);     for (int i = n - 1; i >= 0; i--) {       pos[str[ord[i]]] = i;       char f =    ;       for (char c =  a ; c <=  z ; c++) {         if (c != str[ord[i]] && pos[f] > pos[c]) f = c;       }       las[ord[i]] = f;     }     solve(0, k);     assert(k >= 0);     print_ans(0);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     int n;     cin >> n;     vector<int> a(n);     for (size_t i = 0; i < n; i++) {       cin >> a[i];     }     sort(a.begin(), a.end(), greater<int>());     int x = a[0], y = 0;     for (size_t i = 0; i < n - 1; i++) {       if (x % a[i] != 0 || a[i] == a[i + 1]) {         y = a[i];         break;       }     }     cout << x <<     << y;   }