malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   string rem(string second) {     if (second[second.size() - 1] ==   r ) second.erase(second.size() - 1);     return second;   }   vector<string> split(string second, char delim) {     replace(second.begin(), second.end(), delim,    );     stringstream ss(second);     string buf;     vector<string> v;     while (ss >> buf) v.push_back(buf);     return v;   }   long long fpowm(long long x, unsigned long long y,                   unsigned long long p = LLONG_MAX) {     long long res = 1;     x = x % p;     if (x == 0) return 0;     while (y > 0) {       if (y & 1) res = (res * x) % p;       y = y >> 1;       x = (x * x) % p;     }     return res;   }   inline vector<int> ints(int x) {     vector<int> A(x);     for (int i = 0; i < (x); i++) cin >> A[i];     return A;   }   inline vector<long long> lls(int x) {     vector<long long> A(x);     for (int i = 0; i < (x); i++) cin >> A[i];     return A;   }   inline vector<string> strs(int x) {     vector<string> A(x);     for (int i = 0; i < (x); i++) cin >> A[i];     return A;   }   struct chsh {     static uint64_t splitmix64(uint64_t x) {       x += 0x9e3779b97f4a7c15;       x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;       x = (x ^ (x >> 27)) * 0x94d049bb133111eb;       return x ^ (x >> 31);     }     size_t operator()(uint64_t x) const {       static const uint64_t FIXED_RANDOM =           chrono::steady_clock::now().time_since_epoch().count();       return splitmix64(x + FIXED_RANDOM);     }   };   const int MOD = 1000000007;   const double EPS = 1e-6;   const int MAXN = -1;   int tc() {     int N;     cin >> N;     vector<int> A = ints(3);     string B;     cin >> B;     vector<pair<int, char>> ans;     int R[3];     std::memset(R, 0, sizeof R);     for (int i = 0; i < (N); i++) {       if (B[i] ==  R ) {         if (A[1]) ans.push_back({i,  P }), A[1]--, R[1]++;       } else if (B[i] ==  P ) {         if (A[2]) ans.push_back({i,  S }), A[2]--, R[2]++;       } else {         if (A[0]) ans.push_back({i,  R }), A[0]--, R[0]++;       }     }     if (2 * (int)ans.size() < N) return !(cout <<  NO n );     cout <<  YES n ;     vector<char> rem;     for (int i = 0; i < (3); i++)       for (int j = 0; j < (A[i]); j++) {         if (!i)           rem.push_back( R );         else if (i == 1)           rem.push_back( P );         else if (i == 2)           rem.push_back( S );       }     string ret(N,  ~ );     for (auto first : ans) {       ret[first.first] = first.second;     }     for (int i = 0; i < (N); i++) {       if (ret[i] ==  ~ ) {         ret[i] = rem.front();         rem.erase(rem.begin());       }     }     cout << ret <<   n ;     return 0;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int T;     cin >> T;     while (T--) tc();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, j, k, a, b;   pair<int, int> c[300005];   map<pair<long long, long long>, long long> m;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     for (int i = 0; i < n; i++) {       cin >> a >> b;       c[i] = make_pair(a, b);       m[c[i]] = i;       if (a > b) {         k++;       }     }     sort(c, c + n);     j = n - k;     if (k > j) {       cout << k <<   n ;       for (int i = 0; i < n; i++) {         if (c[i].first > c[i].second) {           cout << m[c[i]] + 1 <<    ;         }       }     } else {       cout << j <<   n ;       for (int i = n - 1; i >= 0; i--) {         if (c[i].first < c[i].second) {           cout << m[c[i]] + 1 <<    ;         }       }     }     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int n;     cin >> n;     int ar[n];     int cnt = 0, cnt2 = 0;     for (int i = 0; i < n; i++) {       cin >> ar[i];       if (ar[i] > 0)         cnt += ar[i];       else         cnt2 += ar[i];     }     cout << cnt - cnt2;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     int n, u, v, c, a, b, t;     cin >> n;     long long w[n], A, B, Su[n], SMax = 0;     int g[n], S[n], Pa[n];     vector<pair<int, long long>> D[n];     vector<int> T, P;     for (int i = 0; i < n; i++) {       cin >> w[i];       g[i] = 1;     }     for (int i = 0; i < n - 1; i++) {       cin >> u >> v >> c;       u--;       v--;       D[u].push_back({v, c});       D[v].push_back({u, c});     }     g[0] = 0;     T.push_back(0);     for (int i = 0; i < T.size(); i++) {       t = 0;       for (int y = 0; y < D[T[i]].size(); y++) {         a = D[T[i]][y].first;         if (g[a] == 1) {           Pa[a] = T[i];           g[a] = 0;           t = 1;           T.push_back(a);         }       }       if (t == 0) {         P.push_back(T[i]);       }     }     T.clear();     for (int i = 0; i < n; i++) {       g[i] = 1;       S[i] = D[i].size() - 1;       if (i == 0) {         S[i]++;       }     }     for (int i = 0; i < P.size(); i++) {       g[P[i]] = 0;       a = P[i];       if (a != 0) {         S[Pa[a]]--;         if (S[Pa[a]] == 0) {           P.push_back(Pa[a]);         }       }       A = 0;       B = 0;       for (int y = 0; y < D[a].size(); y++) {         b = D[a][y].first;         c = D[a][y].second;         if (b != Pa[a]) {           if (Su[b] - c + w[b] > A) {             B = A;             A = Su[b] - c + w[b];           } else if (Su[b] - c + w[b] > B) {             B = Su[b] - c + w[b];           }         }       }       SMax = max(SMax, A + B + w[a]);       Su[a] = A;     }     cout << SMax;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int x = 0, y = 0;     char s[n];     for (int i = 0; i < n; i++) {       cin >> s[i];       if (s[i] ==  0 )         y++;       else         x++;     }     if (x == y) {       cout <<  2  << endl << s[0] <<    ;       for (int i = 1; i < n; i++) cout << s[i];     } else {       cout <<  1  << endl;       for (int i = 0; i < n; i++) cout << s[i];     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, k;   long long a[100010];   signed main() {     scanf( %lld%lld , &n, &k);     long long cnt = 1;     long long l = 1;     long long ans = 0;     for (long long i = 1; i <= n; i++) {       scanf( %lld , &a[i]);       cnt = cnt * a[i] % k;       if (!cnt) {         cnt = 1;         long long j;         for (j = i; j >= 1 && cnt * a[j] % k; j--) cnt = cnt * a[j] % k;         ans += (n - i + 1) * (j - l + 1);         l = j + 1;       }     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 200001;   int n;   vector<pair<int, int> > a[N * 2];   vector<int> odd;   int used[N * 2], cur[N * 2];   char res[N];   void dfs(int u) {     while (cur[u] < a[u].size()) {       int v = a[u][cur[u]].first;       int pos = a[u][cur[u]].second;       if (used[pos]) {         cur[u]++;         continue;       }       if (pos <= n) {         if (u < N) {           res[pos] =  b ;         } else {           res[pos] =  r ;         }       }       used[pos] = 1;       dfs(v);       cur[u]++;     }   }   int main() {     ios_base::sync_with_stdio(0);     cin >> n;     for (int i = 1; i <= n; i++) {       int x, y;       cin >> x >> y;       a[x].push_back(make_pair(y + N, i));       a[y + N].push_back(make_pair(x, i));     }     for (int i = 1; i < N * 2; i++) {       if (a[i].size() % 2) {         odd.push_back(i);       }       used[i] = cur[i] = 0;     }     int cnt = n;     for (int i = 0; i < odd.size(); i += 2) {       cnt++;       a[odd[i]].push_back(make_pair(odd[i + 1], cnt));       a[odd[i + 1]].push_back(make_pair(odd[i], cnt));     }     for (int i = 1; i < N * 2; i++) {       dfs(i);     }     cout << (res + 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long linf = 1e18 + 5;   const int mod = (int)1e9 + 7;   const int logN = 17;   const int inf = 1e9;   const int N = 2e5 + 5;   int n, a[N], s;   vector<pair<long long, long long> > T[N << 2], g[N << 2];   pair<long long, long long> line[N];   long long pre[N];   int P[N << 2];   double intersect(pair<long long, long long> x, pair<long long, long long> y) {     return (y.second - x.second) * 1.0 / (x.first - y.first);   }   void add(vector<pair<long long, long long> > &T, pair<long long, long long> x) {     int s = T.size() - 1;     while (s > 0 && intersect(T[s], T[s - 1]) >= intersect(T[s], x)) {       T.pop_back();       s--;     }     T.push_back(x);   }   void init(int k, int bas, int son) {     P[k] = 0;     if (bas == son) {       T[k].clear();       g[k].clear();       T[k].push_back(line[bas]);       g[k].push_back(line[bas]);       return;     }     init((k + k), bas, (bas + son >> 1));     init((k + k + 1), (bas + son >> 1) + 1, son);     g[k].resize(g[(k + k)].size() + g[(k + k + 1)].size());     merge(g[(k + k)].begin(), g[(k + k)].end(), g[(k + k + 1)].begin(),           g[(k + k + 1)].end(), g[k].begin());     for (__typeof(g[k].begin()) it = g[k].begin(); it != g[k].end(); it++)       add(T[k], *it);     P[k] = 0;   }   long long query(int k, int bas, int son, int x, int y, long long t) {     if (bas > y || son < x) return -linf;     if (x <= bas && son <= y) {       while (P[k] < T[k].size() - 1 && intersect(T[k][P[k]], T[k][P[k] + 1]) <= t)         P[k]++;       return T[k][P[k]].first * t + T[k][P[k]].second;     }     return max(query((k + k), bas, (bas + son >> 1), x, y, t),                query((k + k + 1), (bas + son >> 1) + 1, son, x, y, t));   }   int main() {     scanf( %d , &n);     long long ans = 0;     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       pre[i] = pre[i - 1] + a[i];       ans += a[i] * (long long)i;     }     for (int i = 0; i <= n; i++) line[i] = make_pair(i, pre[n] - pre[i]);     init(1, 0, n);     long long res = -linf;     vector<pair<int, int> > look;     for (int i = 1; i <= n; i++) look.push_back(make_pair(a[i], i));     sort(look.begin(), look.end());     for (__typeof(look.begin()) it = look.begin(); it != look.end(); it++) {       long long left = query(1, 0, n, 0, it->second, it->first);       res = max(res, ans + left - (pre[n] - pre[it->second]) -                          it->second * (long long)it->first);       left = query(1, 0, n, it->second + 2, n, it->first);       res = max(res, ans + left - (pre[n] - pre[it->second]) -                          it->second * (long long)it->first);     }     cout << res <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   char a[22][22], b[22][22], c[22][22];   bool chk() {     for (int i = 0; i < n; i++)       for (int j = 0; j < n; j++)         if (a[i][j] != b[i][j]) return false;     return true;   }   void flip() {     for (int i = 0; i < n; i++)       for (int j = 0; j < n - j - 1; j++) swap(a[i][j], a[i][n - j - 1]);   }   void rotate() {     for (int i = 0; i < n; i++)       for (int j = 0; j < n; j++) c[j][n - i - 1] = a[i][j];     for (int i = 0; i < n; i++)       for (int j = 0; j < n; j++) a[i][j] = c[i][j];   }   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %s , a[i]);     for (int i = 0; i < n; i++) scanf( %s , b[i]);     bool f = false;     for (int i = 0; i < 2 && !f; i++) {       for (int j = 0; j < 4 && !f; j++) {         if (chk()) f = true;         rotate();       }       flip();     }     puts(f ?  Yes  :  No );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline int getc() {     char ch = getchar();     while (ch !=  0  && ch !=  1 ) {       ch = getchar();     }     return ch -  0 ;   }   int main() {     int n;     scanf( %d , &n);     int cnt1 = 0, cnt2 = 0;     for (int i = 0; i < n; ++i) {       if (getc() == i % 2)         cnt1++;       else         cnt2++;     }     printf( %d n , min(cnt1, cnt2));     ;     ;     ;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   struct Segtree {     int n;     T e;     vector<T> dat;     typedef function<T(T a, T b)> Func;     Func f;     Segtree() {}     Segtree(int n_input, Func f_input, T e_input) {       initialize(n_input, f_input, e_input);     }     void initialize(int n_input, Func f_input, T e_input) {       f = f_input;       e = e_input;       n = 1;       while (n < n_input) n <<= 1;       dat.resize(2 * n - 1, e);     }     void update(int k, T a) {       k += n - 1;       dat[k] = a;       while (k > 0) {         k = (k - 1) / 2;         dat[k] = f(dat[2 * k + 1], dat[2 * k + 2]);       }     }     T get(int k) { return dat[k + n - 1]; }     T between(int a, int b) { return query(a, b + 1, 0, 0, n); }     T query(int a, int b, int k, int l, int r) {       if (r <= a || b <= l) return e;       if (a <= l && r <= b) return dat[k];       T vl = query(a, b, 2 * k + 1, l, (l + r) / 2);       T vr = query(a, b, 2 * k + 2, (l + r) / 2, r);       return f(vl, vr);     }   };   void chmin(int64_t& a, int64_t b) { a = min(a, b); }   int main() {     int N, C, A[100000];     cin >> N >> C;     for (int i = 0; i < N; i++) cin >> A[i];     Segtree<int> st(         N, [](int a, int b) { return min(a, b); }, 1e9);     Segtree<int64_t> sum(         N, [](int64_t a, int64_t b) { return a + b; }, 0);     for (int i = 0; i < N; i++) {       st.update(i, A[i]);       sum.update(i, A[i]);     }     vector<int64_t> dp(N + 1, 1e18);     dp[0] = 0;     for (int i = 0; i < N; i++) {       chmin(dp[i + 1], dp[i] + A[i]);       if (i + C <= N)         chmin(dp[i + C],               dp[i] + sum.between(i, i + C - 1) - st.between(i, i + C - 1));     }     cout << dp[N] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dp[2][1 << 16];   char art[7][1008];   int n;   int c[5];   vector<int> modi[1008];   void upd(int &x, int y) { x = min(x, y); }   int main() {     scanf( %d , &n);     for (int i = 1; i <= 4; i++) scanf( %d , &c[i]);     for (int i = 1; i <= 4; i++) scanf( %s , art[i] + 1);     int now = 0;     memset(dp[now], 0x3f, sizeof dp[now]);     dp[now][0] = 0;     for (int i = 1; i <= 4; i++) {       for (int j = 1; j <= 4 - i + 1; j++) {         int mas = (1 << 16) - 1;         for (int x = 0; x < i; x++)           for (int y = j - 1; y < j - 1 + i; y++) {             mas ^= (1 << (x * 4 + y));           }         modi[i].push_back(mas);       }     }     for (int i = 1; i <= n + 4; i++) {       now ^= 1;       memset(dp[now], 0x3f, sizeof dp[now]);       int nm = 0;       for (int j = 1; j <= 4; j++)         if (art[j][i] ==  * ) nm |= (1 << 11 + j);       for (int j = (1 << 16) - 1; j >= 0; j--)         if (dp[now ^ 1][j] < 1e9) {           for (int k = 1; k <= 4; k++)             for (int l = 0; l < modi[k].size(); l++)               upd(dp[now ^ 1][j & modi[k][l]], dp[now ^ 1][j] + c[k]);           if (j & 15) continue;           upd(dp[now][(j >> 4) | nm], dp[now ^ 1][j]);         }     }     printf( %d n , dp[now][0]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 106;   long long d, A[N], f[N];   bool vs[N];   int X[N], Y[N], n;   queue<int> q;   inline long long dis(int a, int b) {     return abs(X[a] - X[b]) + abs(Y[a] - Y[b]);   }   bool judge(long long init) {     memset(f, -1, sizeof f);     while (!q.empty()) q.pop();     memset(vs, 0, sizeof vs);     q.push(1), f[1] = init, vs[1] = 1;     while (!q.empty()) {       int u = q.front();       q.pop(), vs[u] = 0;       for (int i = 1; i <= n; i++) {         if (dis(i, u) * d > f[u] || i == u) continue;         if (f[u] - dis(i, u) * d + A[i] > f[i]) {           f[i] = f[u] - dis(i, u) * d + A[i];           if (!vs[i]) q.push(i), vs[i] = 1;         }       }     }     if (f[n] == -1) return false;     return true;   }   int main() {     scanf( %d%I64d , &n, &d);     for (int i = 2; i < n; i++) scanf( %I64d , &A[i]);     for (int i = 1; i <= n; i++) scanf( %d%d , &X[i], &Y[i]);     long long L = 0, R = ((1LL) << 60);     while (L < R) {       long long mid = (L + R) >> 1;       if (judge(mid))         R = mid;       else         L = mid + 1;     }     if (!judge(L)) L++;     printf( %I64d n , L);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int i, j, n, t, x;     string s =   ;     cin >> t;     for (i = 0; i < t; i++) {       s +=  o ;     }     int ara[t + 5];     ara[0] = 1;     ara[1] = 1;     s[0] =  O ;     s[1] =  O ;     for (i = 2; i <= t; i++) {       ara[i] = ara[i - 1] + ara[i - 2];       if (ara[i] <= t) s[ara[i] - 1] =  O ;       if (ara[i] > t)         break;       else         continue;     }     cout << s <<   n ;     return 0;   }
#include <bits/stdc++.h>   const int INF = 0x3f3f3f3f;   const int maxn = 1e6 + 50;   const int Mod = 1e9 + 7;   using namespace std;   int n, m, sx, sy, dx, dy;   int get(int sx, int sy, int ex, int ey) {     int cx = abs(sx - ex), cy = abs(sy - ey);     if (cx == 0 && cy == 0) return 0;     if (cx % dx != 0 || cy % dy != 0) return INF;     if (sx == ex) {       if (!(sx - dx >= 1 || sx + dx <= n)) return INF;     } else if (sy == ey) {       if (!(sy - dy >= 1 || sy + dy <= m)) return INF;     }     int t1 = cx / dx, t2 = cy / dy;     int cha = abs(t1 - t2);     if (cha & 1) return INF;     return max(t1, t2);   }   int main() {     while (scanf( %d %d %d %d %d %d , &n, &m, &sx, &sy, &dx, &dy) != EOF) {       int ans = INF;       ans = min(get(sx, sy, 1, 1), ans);       ans = min(get(sx, sy, 1, m), ans);       ans = min(get(sx, sy, n, 1), ans);       ans = min(get(sx, sy, n, m), ans);       if (ans == INF)         puts( Poor Inna and pony! );       else         printf( %d n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char op[] = { R ,  G ,  B ,  Y ,  W ,  1 ,  2 ,  3 ,  4 ,  5 };   string s[555];   int main() {     int n, i, j, k;     ios_base::sync_with_stdio(0), cin.tie(0);     cin >> n;     for (i = 1; i <= n; i++) {       cin >> s[i];     }     map<char, bool> mp;     int mn = 100000;     for (int msk = 0; msk < (1024); msk++) {       mp.clear();       for (i = 0; i < 10; i++) {         if (msk & (1 << i)) {           mp[op[i]] = 1;         }       }       bool f = 1;       for (i = 1; i <= n; i++) {         for (j = i + 1; j <= n; j++) {           if (s[i] == s[j]) continue;           if (s[i][0] == s[j][0]) {             if (!mp[s[i][1]] && !mp[s[j][1]]) {               f = 0;               break;             }           } else if (s[i][1] == s[j][1]) {             if (!mp[s[i][0]] && !mp[s[j][0]]) {               f = 0;               break;             }           } else {             if (!mp[s[i][1]] && !mp[s[j][1]] && !mp[s[i][0]] && !mp[s[j][0]]) {               f = 0;               break;             }           }         }         if (!f) break;       }       if (f == 1) mn = min(mn, __builtin_popcount(msk));     }     cout << mn << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     cin >> n >> k;     vector<pair<long long, long long>> v(n);     for (int i = 0; i < n; i++) cin >> v[i].second >> v[i].first;     sort(v.rbegin(), v.rend());     long long ans = 0, sum = 0;     priority_queue<long long, vector<long long>, greater<long long>> pq;     for (int i = 0; i < n; i++) {       pq.push(v[i].second);       sum += v[i].second;       if (pq.size() > k) {         sum -= pq.top();         pq.pop();       }       ans = max(ans, v[i].first * sum);     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e2;   int i, a[N], n;   int main() {     cin >> n;     for (i = 0; i < n; i++) cin >> a[i];     sort(a, a + n);     cout << a[n - 1] <<    ;     for (i = 1; i < n - 1; i++) cout << a[i] <<    ;     cout << a[0];     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int TEST, CASE = 1;   int n, m, a, b, c, k, x, y, z, len, total = 0;   string s, temp, ans;   vector<string> v;   bool cmp(string &a, string &b) {     if (a.size() < b.size())       return true;     else       return false;   }   int main(void) {     cin >> n;     for (int i = 0; i < n; i++) cin >> s, v.push_back(s);     sort(v.begin(), v.end(), cmp);     for (int i = 1; i < n; i++) {       if (v[i].find(v[i - 1]) > v[i].size()) {         cout <<  NO  << endl;         return 0;       }     }     cout <<  YES  << endl;     for (int i = 0; i < n; i++) cout << v[i] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void ga(int N, int *A) {     for (int i(0); i < N; i++) scanf( %d , A + i);   }   unordered_map<int, int> dp;   int N, S[(4000)];   int dyn(int a, int b, int K, bool x) {     if (b - a + 1 < K) return 0;     if (b - a + 1 == K) return (S[b] - (a ? S[a - 1] : 0));     if (dp.count(             (a + (4000) * b + (4000) * (4000) * K + x * (4000) * (4000) * 100)))       return dp[(a + (4000) * b + (4000) * (4000) * K +                  x * (4000) * (4000) * 100)];     if (!x)       return dp[(a + (4000) * b + (4000) * (4000) * K +                  x * (4000) * (4000) * 100)] =                  max(-dyn(a + K, b, K, 1) + (S[a + K - 1] - (a ? S[a - 1] : 0)),                      -dyn(a + K + 1, b, K + 1, 1) +                          (S[a + K] - (a ? S[a - 1] : 0)));     return dp[(a + (4000) * b + (4000) * (4000) * K +                x * (4000) * (4000) * 100)] =                max(-dyn(a, b - K, K, 0) +                        (S[b] - (b - K + 1 ? S[b - K + 1 - 1] : 0)),                    -dyn(a, b - K - 1, K + 1, 0) +                        (S[b] - (b - K ? S[b - K - 1] : 0)));   }   int main(void) {     dp.max_load_factor(.4);     scanf( %d , &N), ga(N, S);     for (int k(1); k < N; k++) S[k] += S[k - 1];     printf( %d n , dyn(0, N - 1, 1, 0));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int Set(int N, int pos) { return N |= (1LL << pos); }   int Reset(int N, int pos) { return N &= ~(1LL << pos); }   bool Check(int N, int pos) { return N & (1LL << pos); }   int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[] = {1, -1, 0, 0, 1, -1, -1, 1};   inline void cn(long &n) {     n = 0;     long ch = getchar();     int sign = 1;     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) sign = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 )       n = (n << 3) + (n << 1) + ch -  0 , ch = getchar();     n = n * sign;   }   template <class T>   void cmin(T &a, T b) {     if (b < a) a = b;   }   template <class T>   void cmax(T &a, T b) {     if (b > a) a = b;   }   template <class T>   int len(const T &c) {     return (int)c.size();   }   template <class T>   int len(char c[]) {     return (int)strlen(c);   }   long stoi(string s) {     long n = 0;     for (int i(0), _n(len(s)); i < _n; ++i) n = n * 10 + (s[i] - 48);     return n;   }   int main() {     ios_base::sync_with_stdio(false);     long m, t, r, w, k, ww, res = 0, ls;     cin >> m >> t >> r;     vector<int> v, tem;     int f = 1;     for (int i(0), _n(m); i < _n; ++i) {       cin >> w;       ls = -100000000000000000LL;       if (!f) continue;       for (int j = len(v) - 1; j >= 0; j--) {         if (v[j] >= w)           tem.push_back(v[j]);         else           break;       }       if (len(tem) < r) {         k = r - len(tem);         ww = w;         for (int j(0), _n(k); j < _n; ++j) {           if (ww + t - 1 >= w) {             res++;             tem.push_back(ww + t - 1);             ww -= 1;           } else {             f = 0;             break;           }         }       }       v = tem;       tem.clear();       sort(v.begin(), v.end());     }     if (f == 0) res = -1;     cout << res;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double pi = acos(-1);   double a, b, c[100005], mx;   int n;   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %lf %lf , &a, &b);       c[i] = (atan2(b, a) * 180) / pi;     }     sort(c, c + n);     for (int i = 0; i < n - 1; i++) {       mx = max(mx, c[i + 1] - c[i]);     }     mx = max(mx, 360 - c[n - 1] + c[0]);     printf( %0.08lf n , 360 - mx);     return 0;   }