malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int inf = 0x3f3f3f3f;   const long long INF = 0x3f3f3f3f3f3f3f3fll;   const int maxn = 1000010;   const long long mod = 1e9 + 7;   char str1[maxn], str2[maxn];   int ans[maxn];   long long L1[maxn], R1[maxn], L2[maxn], R2[maxn];   int main() {     while (scanf( %s , str1 + 1) != -1) {       scanf( %s , str2 + 1);       int len1 = strlen(str1 + 1);       int len2 = strlen(str2 + 1);       if (len1 - 1 != len2) {         printf( 0 n );         continue;       }       L1[0] = 0;       L2[0] = 0;       R1[len1 + 1] = 0;       R2[len2 + 1] = 0;       for (int i = 1; i <= len1; i++) L1[i] = (L1[i - 1] * 26 + str1[i]) % mod;       for (int i = len1; i >= 1; i--) R1[i] = (R1[i + 1] * 26 + str1[i]) % mod;       for (int i = 1; i <= len2; i++) L2[i] = (L2[i - 1] * 26 + str2[i]) % mod;       for (int i = len2; i >= 1; i--) R2[i] = (R2[i + 1] * 26 + str2[i]) % mod;       int len = 0;       for (int i = 1; i <= len1; i++) {         if (L1[i - 1] == L2[i - 1] && R1[i + 1] == R2[i]) ans[len++] = i;       }       printf( %d n , len);       for (int i = 0; i < len; i++) {         if (i == len - 1)           printf( %d n , ans[i]);         else           printf( %d  , ans[i]);       }     }     return 0;   }
#include <bits/stdc++.h>   int main(void) {     int i, j, k, m, n, max_length, length;     char string[101];     for (n = 0, scanf( %s , string); string[n]; n++)       ;     for (m = 1, max_length = 0; m < n; m++) {       for (i = m - 1; i >= 0; i--) {         for (j = i, k = m, length = 0; k && string[j] == string[k];              j--, k--, length++)           ;         if (max_length < length) {           max_length = length;         }       }     }     printf( %d , max_length);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int K;     cin >> K;     int sinir = 2 * K * K;     int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 27, 31, 37, 39};     set<int> mynums;     int i;     for (i = 0; i < sizeof(primes) / sizeof(int); i++) {       mynums.clear();       int t1 = 1, t2 = 1, t = 1;       for (int j = 0; j <= i; j++) t *= primes[j];       for (int j = 0; j <= i / 4; j++) t1 *= primes[j] * primes[i - j];       for (int j = i / 4 + 1; j < i - i / 4; j++) t2 *= primes[j];       mynums.insert(t);       for (int y = 0; y < 30; y++) {         for (int j = 0; j <= i; j++) {           for (set<int>::iterator it = mynums.begin(); it != mynums.end(); it++) {             if (*it * primes[j] <= sinir) {               mynums.insert(*it * primes[j]);             }           }         }       }       if (mynums.size() > K) break;       if (t1 > 1) mynums.insert(t1);       if (t2 > 1) mynums.insert(t2);       for (int y = 0; y < 30; y++) {         for (int j = 0; j <= i; j++) {           for (set<int>::iterator it = mynums.begin(); it != mynums.end(); it++) {             if (*it * primes[j] <= sinir) {               mynums.insert(*it * primes[j]);             }           }         }       }       if (mynums.size() <= K / 2) continue;       if (mynums.size() > K) break;     }     set<int>::iterator it = mynums.end();     it--;     cout << *it;     i = 1;     for (it--; it != mynums.begin() && i < K; it--, i++) cout <<     << *it;     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, k;   char s[504][504];   int vis[504][504];   vector<pair<char, pair<int, int> > > v;   vector<pair<int, int> > ord;   int dx[] = {1, 0, -1, 0};   int dy[] = {0, 1, 0, -1};   void dfs(int x, int y) {     ord.push_back(make_pair(x, y));     for (int i = 0; i < 4; i++)       if (x + dx[i] < n and y + dy[i] < m and x + dx[i] >= 0 and           y + dy[i] >= 0 and s[x + dx[i]][y + dy[i]] !=  #  and           !vis[x + dx[i]][y + dy[i]]) {         vis[x + dx[i]][y + dy[i]] = 1;         dfs(x + dx[i], y + dy[i]);       }   }   int main() {     scanf( %d%d%d , &n, &m, &k);     for (int i = 0; i < n; i++) scanf( %s , &s[i]);     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++)         if (s[i][j] ==  . ) v.push_back(make_pair( B , make_pair(i, j)));     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++)         if (!vis[i][j] and s[i][j] !=  # ) {           ord.clear();           vis[i][j] = 1;           dfs(i, j);           for (int k = ord.size() - 1; k >= 1; k--) {             v.push_back(make_pair( D , ord[k]));             v.push_back(make_pair( R , ord[k]));           }         }     printf( %d n , v.size());     for (int i = 0; i < v.size(); i++)       printf( %c %d %d n , v[i].first, v[i].second.first + 1,              v[i].second.second + 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     char S[110];     scanf( %s , S);     int len = strlen(S);     sort(S, S + len);     for (int i = 0; i < len - 1; i++) {       if (S[i + 1] - S[i] != 1) {         printf( NO n );         return;       }     }     printf( YES n );   }   int main() {     int T;     scanf( %d , &T);     while (T--) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int sqr(long long int x) { return x * x; }   inline long long int add(long long int a, long long int b) {     long long int c = a + b;     if (c >= 1000000007) c -= 1000000007;     return c;   }   inline long long int mul(long long int a, long long int b) {     return (a * 1ll * b) % 1000000007;   }   inline long long int sub(long long int a, long long int b) {     long long int c = a - b;     if (c < 0) c += 1000000007;     return c;   }   const int nax = 1000 * 1000 + 10;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     auto ok = [](vector<int> &v, int pos) {       swap(v[pos + 1], v[pos + 2]);       swap(v[pos], v[pos + 1]);     };     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       vector<int> v(n);       vector<pair<int, int>> x(n);       for (int i = 0; i < n; ++i) {         cin >> v[i];         x[i] = {v[i], i};       }       sort(x.begin(), x.end());       for (int i = 0; i < n; ++i) {         v[x[i].second] = i;       }       int cnt = 0;       for (int i = 0; i < n; ++i) {         for (int j = i + 1; j < n; ++j) {           cnt += (v[j] < v[i]);         }       }       if (cnt & 1) {         for (int i = 0; i < n - 1; ++i) {           if (x[i].first == x[i + 1].first) {             swap(v[x[i].second], v[x[i + 1].second]);             break;           }         }       }       vector<int> ans;       for (int i = 0; i < n - 2; ++i) {         int pos = min_element(v.begin() + i, v.end()) - v.begin();         while (pos > i + 1) {           ok(v, pos - 2);           ans.push_back(pos - 2);           pos -= 2;         }         if (pos != i) {           ok(v, i);           ok(v, i);           ans.push_back(i);           ans.push_back(i);         }       }       for (int i = 0; i < 3; ++i) {         if (is_sorted(v.begin(), v.end())) break;         ok(v, n - 3);         ans.push_back(n - 3);       }       if (!is_sorted(v.begin(), v.end())) {         cout << -1 <<   n ;       } else {         cout << ans.size() <<   n ;         for (int i = 0; i < ans.size(); ++i) cout << ans[i] + 1 <<    ;         cout <<   n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     while (cin >> n) {       string str;       cin >> str;       bool flag = true;       if (n < 3) {         if (n == 1) {           if (str[0] ==  1 )             cout <<  Yes  << endl;           else             cout <<  No  << endl;         } else {           if (str !=  00  && str !=  11 )             cout <<  Yes  << endl;           else             cout <<  No  << endl;         }         continue;       }       for (int i = 0; i < n - 2; i++) {         int ans = 0;         for (int j = i; j < i + 3; j++) {           ans += str[j] -  0 ;         }         if (ans == 1)           continue;         else if (ans == 0 || ans == 3) {           flag = false;           break;         } else {           if (str[i + 1] !=  0 ) {             flag = false;             break;           }         }       }       if (str[0] ==  0  && str[1] ==  0  && str[2] ==  1 ) flag = false;       if (str[n - 1] ==  0  && str[n - 2] ==  0  && str[n - 3] ==  1 )         flag = false;       if (flag)         cout <<  Yes  << endl;       else         cout <<  No  << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   struct SCC {     vector<pair<int, int>> minmax;     int size;     SCC(vector<int> v) {       minmax.resize(v.size());       for (int i = 0; i < (int)v.size(); i++) {         minmax[i].first = v[i];         minmax[i].second = v[i];       }       size = 1;     }     bool operator<(SCC const& other) const {       for (int i = 0; i < (int)minmax.size(); i++) {         if (other.minmax[i].first < minmax[i].second) return false;       }       return true;     }   };   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int n, k;     cin >> n >> k;     set<SCC> s;     for (int i = 0; i < n; i++) {       vector<int> v(k);       for (int i = 0; i < k; i++) {         cin >> v[i];       }       SCC scc(v);       auto a = s.lower_bound(scc);       auto b = s.upper_bound(scc);       if (a != b) {         auto x = a;         while (x != b) {           for (int K = 0; K < k; K++) {             scc.minmax[K].first = min(scc.minmax[K].first, x->minmax[K].first);             scc.minmax[K].second = max(scc.minmax[K].second, x->minmax[K].second);           }           scc.size += x->size;           x++;         }         s.erase(a, b);       }       s.insert(scc);       cout << s.rbegin()->size <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   struct he {     int ind;     int val;     he(int ind_ = 0, int val_ = 0) : ind(ind_), val(val_) {}     bool operator<(const he oth) const { return val > oth.val; }   };   int n, m, k;   vector<int> p[200200], c[200200];   int minv[200200], maxv[200200];   int np[200200], nc[200200];   int ans[200200];   queue<int> q;   priority_queue<he> d_cand, id_cand;   int main() {     cin >> n >> m >> k;     for (int i = 1; i <= n; ++i) {       int a;       cin >> a;       if (a == 0) {         minv[i] = 0;         maxv[i] = k + 1;       } else {         minv[i] = a;         maxv[i] = a;       }     }     for (int i = 0; i < m; ++i) {       int a, b;       cin >> a >> b;       p[b].push_back(a);       c[a].push_back(b);     }     for (int i = 1; i <= n; ++i) {       np[i] = p[i].size();       if (np[i] == 0) {         maxv[i] = min(k, maxv[i]);         q.push(i);       }     }     int reached = 0;     while (!q.empty()) {       int ind = q.front();       q.pop();       ++reached;       for (int x : c[ind]) {         maxv[x] = min(maxv[x], maxv[ind] - 1);         --np[x];         if (np[x] == 0) q.push(x);       }     }     if (reached < n) {       cout <<  -1 n ;       return 0;     }     for (int i = 1; i <= n; ++i) {       nc[i] = c[i].size();       if (nc[i] == 0) {         id_cand.push(he(i, minv[i]));       }     }     for (int step = 1; step <= k; ++step) {       while (!id_cand.empty() && id_cand.top().val <= step) {         int x = id_cand.top().ind;         id_cand.pop();         d_cand.push(he(x, maxv[x]));       }       if (d_cand.empty()) {         cout <<  -1 n ;         return 0;       }       int added = 0;       while (!d_cand.empty() && d_cand.top().val == step) {         ++added;         int x = d_cand.top().ind;         d_cand.pop();         ans[x] = step;         for (int y : p[x]) {           --nc[y];           minv[y] = max(minv[y], step + 1);           if (nc[y] == 0) {             id_cand.push(he(y, minv[y]));           }         }       }       if (added == 0) {         int x = d_cand.top().ind;         d_cand.pop();         if (maxv[x] < step) {           cout <<  -1 n ;           return 0;         }         ans[x] = step;         for (int y : p[x]) {           --nc[y];           minv[y] = max(minv[y], step + 1);           if (nc[y] == 0) {             id_cand.push(he(y, minv[y]));           }         }       }     }     for (int i = 1; i <= n; ++i) {       cout << ans[i] <<    ;     }     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   map<int, int> mp;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int n;     cin >> n;     for (int i = 1; i <= n; i++) {       int num;       cin >> num;       mp[num]++;     }     if (mp.size() != 2) {       cout <<  NO ;       exit(0);     }     if (mp.begin()->second != mp.rbegin()->second) {       cout <<  NO ;       exit(0);     }     cout <<  YES n ;     cout << mp.begin()->first <<     << mp.rbegin()->first;     return 0;   }
#include<cstdio>   #include<iostream>   #include<cstring>   #include<string>   #include<cmath>   #include<map>   #include<algorithm>   #include<vector>   #include<set>   #define Quick ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)   #define ll long long   #define INF 0x3f3f3f3f   #define PI acos(-1)   #define mem(a, b) memset(a, b, sizeof a)   using namespace std;   const int N = 1e6 + 3;   const int mod =1e9 + 7;    int a[N];   ll dp[N];   int vis[N];   int tot = 0;      int main()   {    Quick;    int n; cin >> n;    cout << (n - 1) % 9 + 1 << endl;;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e6 + 5;   int par[N], ran[N];   struct DSU {     DSU() {       for (int i = 1; i < N; ++i) par[i] = i, ran[i] = 1;     }     int find(int x) { return par[x] == x ? x : par[x] = find(par[x]); }     bool unite(int a, int b) {       a = find(a), b = find(b);       if (a == b) return false;       ran[a] += ran[a] == ran[b];       if (ran[a] < ran[b]) swap(a, b);       par[b] = a;       return true;     }   };   int a[N];   int n, q;   vector<int> primes;   int spf[N];   void sieve() {     for (int i = 2; i < N; ++i) {       if (spf[i] == 0) spf[i] = i, primes.push_back(i);       int sz = primes.size();       for (int j = 0; j < sz && i * primes[j] < N && primes[j] <= spf[i]; ++j) {         spf[i * primes[j]] = primes[j];       }     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     sieve();     cin >> n >> q;     DSU ds;     for (int i = 1; i <= n; ++i) {       cin >> a[i];     }     for (int i = 1; i <= n; ++i) {       int x = a[i];       while (x > 1) {         ds.unite(spf[a[i]], spf[x]);         x /= spf[x];       }     }     set<pair<int, int>> pary;     for (int i = 1; i <= n; ++i) {       int x = a[i];       vector<int> v;       while (x > 1) {         v.push_back(spf[x]);         x /= spf[x];       }       x = a[i] + 1;       while (x > 1) {         v.push_back(spf[x]);         x /= spf[x];       }       v.resize(unique(v.begin(), v.end()) - v.begin());       for (auto &j : v) {         j = ds.find(j);       }       for (auto j : v) {         for (auto k : v) {           if (j < k) pary.insert({j, k});         }       }     }     while (q--) {       int x, y;       cin >> x >> y;       x = spf[a[x]], y = spf[a[y]];       if (ds.find(x) == ds.find(y))         cout << 0 << endl;       else {         x = ds.find(x);         y = ds.find(y);         if (x > y) swap(x, y);         if (pary.count({x, y}))           cout << 1 << endl;         else           cout << 2 << endl;       }     }   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   bool dp[505][505];   int c[505];   int N, K, a[505], b[505];   long long s1, s2;   int main() {     ios::sync_with_stdio(false);     cin >> N >> K;     for (int i = 1; i <= N; ++i) cin >> a[i] >> b[i], s1 += a[i], s2 += b[i];     dp[0][0] = 1;     for (int i = 0; i < N; ++i) {       for (int j = 0; j < K; ++j) c[j] = 0, dp[i + 1][j] = dp[i][j];       if (a[i + 1] + b[i + 1] >= K)         for (int j = 0; j < K; ++j) {           if (!dp[i][j]) continue;           int l, r;           l = max(1, K - b[i + 1]);           r = min(K - 1, a[i + 1]);           if (l <= r) {             int St, Ed;             St = j + l;             Ed = j + r;             St %= K;             Ed %= K;             c[St]++;             if (Ed >= St) {               c[Ed + 1]--;             } else {               c[0]++;               c[Ed + 1]--;             }           }         }       for (int j = 0; j < K; ++j) {         if (j) c[j] += c[j - 1];         dp[i + 1][j] |= c[j];       }     }     long long res = 0;     for (int j = 0; j < K; ++j) {       if (!dp[N][j]) continue;       long long l1, l2;       l1 = s1, l2 = s2;       l1 -= j;       l2 -= (K - j) % K;       long long cur = bool(j) + (l1 / K) + (l2 / K);       res = max(res, cur);     }     cout << res << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     char ch;     int n, cnt = 0;     long long x, a;     scanf( %d%I64d , &n, &x);     for (int i = 0; i < n; i++) {       while (isspace(ch = getchar()))         ;       scanf( %I64d , &a);       if (ch ==  + )         x += a;       else {         if (x < a)           cnt++;         else           x -= a;       }     }     cout << x <<     << cnt << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, a[100009];   int main() {     cin >> n;     if (n == 1)       cout << 1;     else if ((n / 2) % 2 == 1)       cout << -1;     else {       for (int i = 1; i <= (n / 2 / 2); i++) {         a[i * 2 - 1] = i * 2;         a[i * 2] = n - (i - 1) * 2;         a[n - i * 2 + 1] = i * 2 - 1;         a[n - (i - 1) * 2] = n - (i - 1) * 2 - 1;         if (n % 2 == 1) a[n / 2 + 1] = n / 2 + 1;       }       for (int i = 1; i <= n; i++) cout << a[i] <<    ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 200005;   int cnt[N];   int n, k;   int cut[N];   vector<pair<int, int> > arr;   struct Sub {     bool operator()(pair<int, pair<int, int> > a, pair<int, pair<int, int> > b) {       if (a.first != b.first)         return a.first < b.first;       else         return (cnt[a.second.second] / (a.second.first + 1)) <                (cnt[b.second.second] / (b.second.first + 1));     }   };   bool ForSort(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }   int main() {     scanf( %d%d , &n, &k);     int tx;     for (int i = 1; i <= n; i++) scanf( %d , &tx), cnt[tx]++;     for (int i = 1; i <= 200000; i++)       if (cnt[i] > 0) arr.push_back({cnt[i], i});     sort(arr.begin(), arr.end(), ForSort);     priority_queue<pair<int, pair<int, int> >,                    vector<pair<int, pair<int, int> > >, Sub>         pq;     int len = 1, ex = arr[0].first;     cut[arr[0].second] = 1;     cout << arr[0].second <<    ;     pq.push(pair<int, pair<int, int> >(arr[0].first,                                        pair<int, int>(1, arr[0].second)));     int i = 1;     pair<int, pair<int, int> > u =         pair<int, pair<int, int> >(2, pair<int, int>(10, 1));     pair<int, pair<int, int> > v =         pair<int, pair<int, int> >(2, pair<int, int>(4, 2));     while (len < k) {       pair<int, pair<int, int> > u = pq.top();       if (i >= arr.size()) {         if (cut[u.second.second] + 1 <= cnt[u.second.second]) {           len++;           cut[u.second.second] = u.second.first + 1;           pq.pop();           cout << u.second.second <<    ;           pq.push(pair<int, pair<int, int> >(               cnt[u.second.second] / (u.second.first + 1),               pair<int, int>(u.second.first + 1, u.second.second)));         } else           pq.pop();       } else {         if (u.second.first + 1 <= cnt[u.second.second] &&             cnt[u.second.second] / (u.second.first + 1) > arr[i].first) {           cut[u.second.second] = u.second.first + 1;           cout << u.second.second <<    ;           len++;           pq.pop();           pq.push(pair<int, pair<int, int> >(               cnt[u.second.second] / (u.second.first + 1),               pair<int, int>(u.second.first + 1, u.second.second)));         } else {           ex = min(ex, arr[i].first);           cut[arr[i].second] = 1;           cout << arr[i].second <<    ;           len++;           pq.push(pair<int, pair<int, int> >(arr[i].first,                                              pair<int, int>(1, arr[i].second)));           i++;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 300010;   long long n, a[N], t;   map<long long, bool> vis;   int solve() {     scanf( %lld , &t);     while (t--) {       scanf( %lld , &n);       vis.clear();       bool imp = 0;       for (int i = 1; i <= n; i++) {         scanf( %lld , &a[i]);         long long nw = (i + a[i]) % n;         if (nw < 0) nw += n;         if (vis[nw]) {           imp = 1;         }         vis[nw] = 1;       }       if (imp)         printf( NO n );       else         printf( YES n );     }     return 0;   }   int main() { return solve(); }
#include <bits/stdc++.h>   using namespace std;   void file() {}   void fast() {     std::ios_base::sync_with_stdio(0);     cin.tie(NULL);   }   const int N = 510 + 20;   const double PI = acos(-1.0);   bool cmp(complex<double> a, complex<double> b) {     if (a.real() == b.real()) return a.imag() < b.imag();     return a.real() < b.real();   }   bool cmp_doub(double a, double b) {     if (fabs(a - b) <= 1e-9) {       return 1;     }     return 0;   }   bool is_correct(complex<double> p1, complex<double> p2, complex<double> p3,                   complex<double> p4) {     vector<double> dists;     double dist1 = (hypot((p1 - p2).imag(), (p1 - p2).real()));     double dist2 = (hypot((p2 - p4).imag(), (p2 - p4).real()));     double dist3 = (hypot((p3 - p4).imag(), (p3 - p4).real()));     double dist4 = (hypot((p3 - p1).imag(), (p3 - p1).real()));     double dist5 = (hypot((p2 - p3).imag(), (p2 - p3).real()));     double dist6 = (hypot((p1 - p4).imag(), (p1 - p4).real()));     dists.push_back(dist1);     dists.push_back(dist2);     dists.push_back(dist3);     dists.push_back(dist4);     dists.push_back(dist5);     dists.push_back(dist6);     sort(((dists).begin()), ((dists).end()));     if (dists[0] > 0 && cmp_doub(dists[0], dists[1]) &&         cmp_doub(dists[1], dists[2]) && cmp_doub(dists[2], dists[3]) &&         cmp_doub(dists[3], dists[2])) {       if (cmp_doub(dists[4], dists[5]) && !cmp_doub(dists[5], dists[0])) {         return 1;       }     }     return 0;   }   complex<double> rotate(complex<double> a, complex<double> b, int c) {     for (int i = 0; i < c; i++) {       a = (((((a) - (b))) * exp(complex<double>(0, PI / 2.0))) + b);     }     return a;   }   int main() {     file();     fast();     int n;     cin >> n;     for (int i = 0; i < n; i++) {       vector<pair<complex<double>, complex<double>>> points;       for (int j = 0; j < 4; j++) {         int x, y, z, m;         cin >> x >> y >> z >> m;         points.push_back({complex<double>(x, y), complex<double>(z, m)});       }       int ans = 1e9;       for (int j1 = 0; j1 < 4; j1++) {         for (int j2 = 0; j2 < 4; j2++) {           for (int j3 = 0; j3 < 4; j3++) {             for (int j4 = 0; j4 < 4; j4++) {               vector<complex<double>> points1(4);               points1[0] = rotate(points[0].first, points[0].second, j1);               points1[1] = rotate(points[1].first, points[1].second, j2);               points1[2] = rotate(points[2].first, points[2].second, j3);               points1[3] = rotate(points[3].first, points[3].second, j4);               if (is_correct(points1[0], points1[1], points1[2], points1[3])) {                 ans = min(ans, j1 + j2 + j3 + j4);               }             }           }         }       }       if (ans == 1e9) ans = -1;       cout << ans << endl;     }   }