malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int ss = 1000;   int n, k, ans, x;   bool flag1, flag2;   bool a[5000][5000];   int b[1002], tot;   int main() {     scanf( %d%d , &n, &k);     memset(a, false, sizeof(a));     memset(b, false, sizeof(b));     flag1 = flag2 = false;     n += ss;     for (int i = 1; i <= k; ++i) {       scanf( %d , &x);       a[0][x + ss] = true;       if (x + ss > n) flag1 = true;       if (x + ss < n) flag2 = true;     }     tot = 0;     for (int i = 0; i <= 1000 + ss; ++i) {       if (a[0][i]) b[++tot] = i;     }     if (a[0][n])       ans = 1;     else if (flag1 ^ flag2 || (k == 1))       ans = -1;     else       for (int i = 1; i <= 5010; ++i) {         for (int j = 0; j <= 3000; ++j)           if (a[i - 1][j]) {             for (int k = 1; k <= tot; ++k) {               if (j + b[k] - n >= 0 && j + b[k] - n <= 3000) {                 a[i][j + b[k] - n] = true;               }             }           }         if (a[i][n]) {           ans = i + 1;           break;         }       }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int q;     cin >> q;     while (q--) {       long long n, a, b;       cin >> n >> a >> b;       if (n == 1) {         cout << a << endl;         continue;       }       if (n % 2 == 0) {         long long gu = min(n * a, (n / 2) * b);         cout << gu << endl;       } else {         long long gu = min(n * a, (n / 2) * b + a);         cout << gu << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   int pwr(int a, long long b) {     int res = 1;     for (; b; b >>= 1) {       if (b & 1) res = 1LL * res * a % MOD;       a = 1LL * a * a % MOD;     }     return res;   }   int T, n;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     T = 1;     while (T--) {       cin >> n;       if (n == 1) return cout << 6 <<   n , 0;       long long x = (1LL << n);       x -= 2;       cout << 1LL * 6 * pwr(4, x) % MOD <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s, c;     int n, t = 0;     cin >> n;     cin >> s >> c;     for (int i = 0; i < n; i++) {       int p = s[i], k = c[i];       if (p <= k)         t += min(abs(p - k), (p + 1) + (9 - k));       else         t += min((9 - p) + (k + 1), abs(p - k));     }     cout << t << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX_BUF_SIZE = 16384;   char BUFOR[MAX_BUF_SIZE];   int BUF_SIZE, BUF_POS;   char ZZZ;   const int MXN = 100010;   const int C = 262144;   const int INF = 1000000001;   string a[MXN];   int aa;   int typ[MXN], gender[MXN];   string fem[3] = { liala ,  etra ,  inites };   string masc[3] = { lios ,  etr ,  initis };   string mowa[6] = { lios ,  etr ,  initis ,  liala ,  etra ,  inites };   int n;   void test() {     string tmp;     while (cin >> tmp) a[aa++] = tmp;     n = aa;     bool czy = 1;     for (int i = 0; i < aa; i++) {       int dec = -1;       gender[i] = -1;       for (int j = 0; j < 3; j++) {         string w = masc[j];         if (w.length() <= a[i].length() &&             w == string(a[i], (int)(a[i]).size() - (int)(w).size(),                         (int)(w).size()))           dec = 1;         gender[i] = dec;       }       dec = -1;       for (int j = 0; j < 3; j++) {         string w = fem[j];         if (w.length() <= a[i].length() &&             w == string(a[i], (int)(a[i]).size() - (int)(w).size(),                         (int)(w).size()))           dec = 0;         if (gender[i] == -1) gender[i] = dec;       }       for (int j = 0; j < 6; j++) {         string w = mowa[j];         typ[i] = -1;         if (w.length() <= a[i].length() &&             w == string(a[i], (int)(a[i]).size() - (int)(w).size(),                         (int)(w).size())) {           typ[i] = j % 3;           break;         }       }       if (gender[i] == -1 || typ[i] == -1) czy = 0;     }     int iter = 0;     while (iter < n && typ[iter] == 0) iter++;     if (typ[iter] == 1)       iter++;     else if (n > 1)       czy = 0;     while (czy && iter < n)       if (typ[iter++] != 2) czy = 0;     for (int i = 1; i < n; i++)       if (gender[0] != gender[i]) czy = 0;     if (czy)       printf( YES n );     else       printf( NO n );   }   int main() {     int te = 1;     while (te--) test();   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   const int N = 1e5;   class union_find {     int n, no_of_comp;     vector<int> par, sz;       public:     union_find(int nv) {       n = no_of_comp = nv;       par = sz = vector<int>(n + 1, 1);       for (int i = 1; i <= n; i++) par[i] = i;     }     int get_root(int i) {       while (i != par[i]) i = par[i];       return i;     }     void take_union(int i, int j) {       int u = get_root(i);       int v = get_root(j);       if (u == v) return;       if (sz[u] < sz[v]) swap(u, v);       par[v] = u;       sz[u] += sz[v];       no_of_comp--;     }     int num_of_comp() { return no_of_comp; }   };   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, m;     cin >> n >> m;     union_find dsu(n);     for (int i = 0; i < m; i++) {       int u, v;       cin >> u >> v;       dsu.take_union(u, v);     }     cout << (long long)pow(2, n - dsu.num_of_comp());   }
#include <bits/stdc++.h>   using namespace std;   vector<long long> com;   vector<long long> all;   long long c, a, n, k, mm;   void solve() {     long long s = 0, e = (long long)1e9 * 2 + 5;     long long mid = 0;     long long sum = 0;     while (s <= e) {       mid = (s + e) / 2;       for (int i = 0; i < n; i++) {         sum += max((long long)0, (com[i] * mid - all[i]));         if (sum > (long long)1e18) {           sum = k + 1;           break;         }       }       if (sum <= k) {         mm = mid;         s = mid + 1;       } else         e = mid - 1;       sum = 0;     }     cout << mm;   }   int main() {     cin >> n >> k;     for (int i = 0; i < n; i++) {       cin >> c;       com.push_back(c);     }     for (int i = 0; i < n; i++) {       cin >> a;       all.push_back(a);     }     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline bool equal(double _x, double _y) {     return _x > _y - 1e-9 && _x < _y + 1e-9;   }   int l[105], r[105], t[105], c[105], ans, mx, id;   int main() {     int n, m;     scanf( %d%d , &n, &m);     for (int i = 0; i < m; i++) scanf( %d%d%d%d , &l[i], &r[i], &t[i], &c[i]);     for (int j = 1; j <= n; j++) {       mx = 1e9;       id = -1;       for (int i = 0; i < m; i++) {         if (l[i] <= j && j <= r[i] && t[i] < mx) {           mx = t[i];           id = i;         }       }       if (~id) ans += c[id];     }     printf( %d n , ans);   }
#include <bits/stdc++.h>   using namespace std;   const double eps = 1e-9;   const int mod = (int)1e+9 + 7;   const double pi = acos(-1.);   const int maxn = 100100;   int x[maxn];   int z[10 * maxn];   int a, b;   void fill(int u) {     int lpos = (u - b % u) % u;     for (; lpos <= a - b; lpos += u) {       z[lpos] = max(z[lpos], lpos + u - 1);     }   }   int main() {     srand(time(0));     const string file =   ;     if (!file.empty()) {       freopen((file +  .in ).c_str(),  r , stdin);       freopen((file +  .out ).c_str(),  w , stdout);     }     int n;     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %d , &x[i]);     }     scanf( %d%d , &a, &b);     sort(&x[0], &x[n]);     n = unique(&x[0], &x[n]) - &x[0];     for (int i = 0; i < 10 * maxn; i++) {       z[i] = i + 1;     }     for (int i = 0; i < n; i++) {       fill(x[i]);     }     for (int i = 1; i <= a - b; i++) {       z[i] = max(z[i], z[i - 1]);     }     int cnt = 0;     for (int i = 0; i < a - b;) {       i = z[i];       cnt++;     }     cout << cnt;     return (0);   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 1000000000;   const int MOD = 1000000007;   const int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};   const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};   int n, m;   char grid[65][65];   bool row(int row, char c) {     for (int i = 0; i < m; i++)       if (grid[row][i] != c) return false;     return true;   }   bool col(int col, char c) {     for (int i = 0; i < n; i++)       if (grid[i][col] != c) return false;     return true;   }   void solve() {     cin >> n >> m;     int a = 0, b = 0;     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++) {         cin >> grid[i][j];         if (grid[i][j] ==  A )           ++a;         else           ++b;       }     if (a == 0) {       cout <<  MORTAL             <<   n ;       return;     }     if (b == 0) {       cout << 0 <<   n ;       return;     }     if (row(0,  A ) || row(n - 1,  A ) || col(0,  A ) || col(m - 1,  A )) {       cout << 1 <<   n ;       return;     }     for (int i = 0; i < n; i++)       if (row(i,  A )) {         cout << 2 <<   n ;         return;       }     for (int i = 0; i < m; i++)       if (col(i,  A )) {         cout << 2 <<   n ;         return;       }     if (grid[0][0] ==  A  || grid[n - 1][0] ==  A  || grid[0][m - 1] ==  A  ||         grid[n - 1][m - 1] ==  A ) {       cout << 2 <<   n ;       return;     }     for (int i = 0; i < n; i++) {       if (grid[i][0] ==  A  || grid[i][m - 1] ==  A ) {         cout << 3 <<   n ;         return;       }     }     for (int j = 0; j < m; j++) {       if (grid[0][j] ==  A  || grid[n - 1][j] ==  A ) {         cout << 3 <<   n ;         return;       }     }     cout << 4 <<   n ;   }   signed main() {     cin.tie(0), cout.tie(0);     ios::sync_with_stdio(0);     int q;     cin >> q;     while (q--) solve();     return 0;   }
#include <bits/stdc++.h>   #pragma warning(disable : 4996)   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     string s, t;     cin >> s >> t;     int n = s.size(), m = t.size();     vector<vector<int> > f(n + 1);     vector<vector<int> > what(n + 1);     vector<vector<pair<int, int> > > from(n + 1);     for (int i = 0; i < int((f).size()); i++)       f[i].resize(m + 1), what[i].resize(m + 1), from[i].resize(m + 1);     for (int i = 0; i <= n; ++i)       for (int j = 0; j <= m; ++j) {         if (i == 0 && j == 0) continue;         int a, b, c, d;         a = b = c = d = 1000000000;         if (i - 1 >= 0 && j - 1 >= 0 && s[i - 1] == t[j - 1]) a = f[i - 1][j - 1];         if (i - 1 >= 0) b = f[i - 1][j] + 1;         if (j - 1 >= 0) c = f[i][j - 1] + 1;         if (i - 1 >= 0 && j - 1 >= 0) d = f[i - 1][j - 1] + 1;         int mn = min(min(a, b), min(c, d));         if (mn == b)           what[i][j] = 1, from[i][j] = make_pair(i - 1, j);         else if (mn == c)           what[i][j] = 2, from[i][j] = make_pair(i, j - 1);         else if (mn == d)           what[i][j] = 3, from[i][j] = make_pair(i - 1, j - 1);         else           from[i][j] = make_pair(i - 1, j - 1);         f[i][j] = mn;       }     cout << f[n][m] << endl;     int i = n, j = m;     while (i != 0 || j != 0) {       if (what[i][j] == 1)         cout <<  DELETE   << i << endl;       else if (what[i][j] == 2)         cout <<  INSERT   << i + 1 <<     << t[j - 1] << endl;       else if (what[i][j] == 3)         cout <<  REPLACE   << i <<     << t[j - 1] << endl;       pair<int, int> h = from[i][j];       i = h.first;       j = h.second;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int m = pow(10, 9) + 7;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     string s, t;     cin >> s >> t;     int j = 0, l = -1, r = -1;     for (int i = 0; i < t.length(); i++) {       if (s[j] == t[i]) j++;       if (j == s.length()) {         l = i + 1;         break;       }     }     reverse(s.begin(), s.end());     j = 0;     reverse(t.begin(), t.end());     for (int i = 0; i < t.length(); i++) {       if (s[j] == t[i]) j++;       if (j == s.length()) {         r = t.length() - i;         break;       }     }     if (l >= r || l == -1 || r == -1)       cout << 0 << endl;     else       cout << r - l << endl;     return 0;   }
#include <bits/stdc++.h>   bool local = false;   using namespace std;   template <class T>   string toString(T x) {     ostringstream sout;     sout << x;     return sout.str();   }   template <class T>   void print(T v) {     cout << ((int)(v).size()) <<   n ;     for (auto x : v) cout << x <<    ;     cout <<   n ;   };   template <class T>   void print1(T v) {     cout << ((int)(v).size()) <<   n ;     for (auto x : v) cout << x + 1 <<    ;     cout <<   n ;   };   template <class T1, class T2>   ostream &operator<<(ostream &o, pair<T1, T2> x) {     return o << x.first <<     << x.second;   }   template <class T1, class T2>   istream &operator>>(istream &o, pair<T1, T2> &x) {     return o >> x.first >> x.second;   }   template <class T1, class T2>   pair<T1, T2> operator+(pair<T1, T2> a, pair<T1, T2> b) {     a.first += b.first;     a.second += b.second;     return a;   }   template <class T1, class T2>   pair<T1, T2> operator-(pair<T1, T2> a, pair<T1, T2> b) {     a.first -= b.first;     a.second -= b.second;     return a;   }   template <class T1, class T2>   void operator+=(pair<T1, T2> &a, pair<T1, T2> b) {     a.first += b.first;     a.second += b.second;   }   template <class T1, class T2>   void operator-=(pair<T1, T2> &a, pair<T1, T2> b) {     a.first -= b.first;     a.second -= b.second;   }   int nint() {     int x;     cin >> x;     return x;   }   double getTime() { return clock() / (double)CLOCKS_PER_SEC; };   mt19937 rnd(0);   int rand(int n) { return rnd() % n; }   int rand(int l, int r) { return rnd() % (r - l + 1) + l; }   const int mod = 1000000000 + 7;   void initIO() {     if (local) {       freopen( input.txt ,  r , stdin);       srand((int)time(0));       rnd.seed((int)time(0));     } else {     }     {       ios::sync_with_stdio(0);       cin.tie(0);       cout.tie(0);     };   }   void solve();   int main() {     initIO();     int tc = 1;     for (int tt = 0; tt < (tc); tt++) {       solve();     }     if (local)       cout <<   n             <<  time =   << getTime() <<   n ;   }   int n;   int m;   vector<int> v1, v2;   pair<int, int> val[300500];   bool f1(int a, int b) { return val[a].second > val[b].second; }   bool f2(int a, int b) { return val[a].second < val[b].second; }   void solve() {     cin >> n;     for (int i = 0; i < (n); i++) {       pair<int, int> o;       cin >> o;       val[i] = o;       if (o.first > o.second)         v2.emplace_back(i);       else         v1.emplace_back(i);     }     sort(v1.begin(), v1.end(), f1);     sort(v2.begin(), v2.end(), f2);     if (((int)(v1).size()) > ((int)(v2).size()))       print1(v1);     else       print1(v2);   }
#include <bits/stdc++.h>   using namespace std;   const long long BIG = 1000000000000000000LL;   void solve();   signed main() {     ios::sync_with_stdio(false);     cin.tie(0);     solve();     return 0;   }   const long long borne = 3 * (long long)(1e5) + 5;   long long tab[borne];   long long som[borne];   long long nbElem, nbParties;   void solve() {     cin >> nbElem >> nbParties;     for (long long i = (0); i < (nbElem); ++i) {       cin >> tab[i];     }     som[0] = tab[0];     for (long long i = (1); i < (nbElem); ++i) som[i] = tab[i] + som[i - 1];     vector<long long> ww(nbElem - 1);     for (long long i = (0); i < (nbElem - 1); ++i) ww[i] = som[i];     sort(ww.begin(), ww.end());     long long res = nbParties * som[nbElem - 1];     for (long long i = (0); i < (nbParties - 1); ++i) res -= ww[i];     cout << res <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long a, b, c, x;     cin >> a >> b >> c;     if (a * c % 100 == 0)       x = (a * c) / 100;     else       x = (a * c) / 100 + 1;     if (x < b)       cout <<  0  << endl;     else       cout << x - b << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct node {     char name[20];     int id;     int num;   } a[100005];   bool cmp(node x, node y) {     if (x.id == y.id) return x.num > y.num;     return x.id < y.id;   }   int main() {     int n, m;     while (cin >> n >> m) {       for (int i = 0; i < n; i++) {         scanf(  %s %d %d , a[i].name, &a[i].id, &a[i].num);       }       sort(a, a + n, cmp);       int st = 0, ed = 0;       for (st = 0; st < n; st = ed) {         while (ed < n && a[ed].id == a[st].id) ed++;         int fir = a[st].num;         int sec = a[st + 1].num;         if (ed - st > 2 && sec == a[st + 2].num) {           printf( ? n );         } else {           printf( %s %s n , a[st].name, a[st + 1].name);         }       }     }     return 0;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC optimize( unroll-loops )   #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native )   using namespace std;   const int maxn = 4e2 + 5, maxk = 4e2 + 5, inf = 1e9 + 69, delta = 1e9 + 7,             max_sum = 10000 + 5;   inline void in_out_optimize() {     ios::sync_with_stdio(false);     cout.tie(0);     cin.tie(0);   }   int main() {     in_out_optimize();     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       long long eq = inf - (inf % n);       set<int> dest;       for (int i = 0; i < n; i++) {         int a;         cin >> a;         if (a < 0) a += eq;         a %= n;         dest.insert((i + a) % n);       }       if (dest.size() == n)         cout <<  YES n ;       else         cout <<  NO n ;     }   }
#include <bits/stdc++.h>   using namespace std;   int k;   string n, m;   int a[1001], b[1001], ns, ms;   int fs, ss;   int lcm(int, int);   int gcd(int, int);   int main() {     cin >> k >> n >> m;     ns = n.size();     ms = m.size();     for (int i = 0; i < ns; i++) {       a[i] = (n[i] ==  R  ? 0 : (n[i] ==  P  ? 1 : 2));     }     for (int i = 0; i < ms; i++) {       b[i] = (m[i] ==  R  ? 0 : (m[i] ==  P  ? 1 : 2));     }     int q = 0, p = 0, l = lcm(ns, ms);     for (int i = 0; i < l; i++) {       if ((a[q] == 0 && b[p] == 2) || (a[q] == 2 && b[p] == 1) ||           (a[q] == 1 && b[p] == 0))         fs++;       else if (a[q] != b[p])         ss++;       q++, p++;       if (q == ns) q = 0;       if (p == ms) p = 0;     }     fs *= k / l;     ss *= k / l;     p = q = 0;     for (int i = 0; i < k % l; i++) {       if ((a[q] == 0 && b[p] == 2) || (a[q] == 2 && b[p] == 1) ||           (a[q] == 1 && b[p] == 0))         fs++;       else if (a[q] != b[p])         ss++;       q++, p++;       if (q == ns) q = 0;       if (p == ms) p = 0;     }     cout << ss <<     << fs;   }   int lcm(int q, int p) { return q * p / gcd(q, p); }   int gcd(int q, int p) {     if (q > p) {       q += p, p = q - p, q -= p;     }     if (!q) return p;     return gcd(p - q, q);   }
#include <bits/stdc++.h>   using namespace std;   char buf[1 << 21], *p1 = buf, *p2 = buf;   template <class T>   void read(T &x) {     x = 0;     int c = getchar();     int flag = 0;     while (c <  0  || c >  9 ) flag |= (c ==  - ), c = getchar();     while (c >=  0  && c <=  9 )       x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();     if (flag) x = -x;   }   template <class T>   T _max(T a, T b) {     return b < a ? a : b;   }   template <class T>   T _min(T a, T b) {     return a < b ? a : b;   }   template <class T>   bool checkmax(T &a, T b) {     return a < b ? a = b, 1 : 0;   }   template <class T>   bool checkmin(T &a, T b) {     return b < a ? a = b, 1 : 0;   }   const int N = 1000005;   int n;   int a[N], b[N], sa[N], sb[N];   void init() {     read(n);     for (int i = 1; i <= n; ++i) read(a[i]);     for (int i = 1; i <= n; ++i) read(b[i]);     sa[n + 1] = 0;     for (int i = n; i >= 1; --i) sa[i] = sa[i + 1] + a[i];     sb[0] = 0;     for (int i = 1; i <= n; ++i) sb[i] = sb[i - 1] + b[i];   }   void solve() {     int ans = -1;     for (int i = 1; i <= n; ++i) {       int w = max(sb[i - 1], sa[i + 1]);       if (i == 1)         ans = w;       else         checkmin(ans, w);     }     printf( %d n , ans);   }   int main() {     int t;     read(t);     while (t--) {       init();       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double dist(double x1, double y1, double x2, double y2) {     double dx = x1 - x2;     double dy = y1 - y2;     return sqrt(dx * dx + dy * dy);   }   double catet(double a, int b) {     double z = a * a - b * b;     if (z < 1e-12) z = 0;     return sqrt(z);   }   int main() {     int xp, yp, vp;     cin >> xp >> yp >> vp;     int x, y, v, r;     cin >> x >> y >> v >> r;     const double eps = 1e-10;     const double R = sqrt(1.0 * xp * xp + 1.0 * yp * yp);     double lo = 0;     double hi = 1e7;     double T;     while ((hi - lo) / hi > eps) {       T = (lo + hi) / 2;       const double alpha = T / (R / vp);       double nx = xp * cos(alpha) - yp * sin(alpha);       double ny = xp * sin(alpha) + yp * cos(alpha);       double a = ny - y;       double b = x - nx;       double c = -(a * x + b * y);       double z = sqrt(a * a + b * b);       a /= z;       b /= z;       c /= z;       double need;       if (fabs(c) < r - 1e-8) {         double mx = a * (-c);         double my = b * (-c);         if (dist(x, y, mx, my) + dist(mx, my, nx, ny) >             dist(x, y, nx, ny) + 1e-8) {           need = dist(x, y, nx, ny);         } else {           need = catet(dist(x, y, 0, 0), r) + catet(dist(nx, ny, 0, 0), r);           double alp = fabs(atan2(y, x) - atan2(ny, nx));           if (alp > M_PI) alp = 2 * M_PI - alp;           alp -= acos(r / dist(x, y, 0, 0));           alp -= acos(r / dist(nx, ny, 0, 0));           need += alp * r;         }       } else {         need = dist(x, y, nx, ny);       }       if (need <= v * T) {         hi = T;       } else {         lo = T;       }     }     printf( %.6f n , T);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, q;   long long f(long long md) { return n - md + min(n - md, md * (md - 1) / 2); }   signed main() {     cin >> q;     while (q--) {       cin >> n;       long long lo = 1, hi = n;       while (lo + 1 < hi) {         long long md = (lo + hi) >> 1;         if (f(md) < f(md + 1))           lo = md;         else           hi = md;       }       cout << max(f(hi), f(lo)) << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long maxn = 100005;   long long n, x[maxn], y[maxn];   bool flag;   inline long long nxt(long long id) { return (id + 1) % n; }   inline bool check(long long i, long long j) {     return (x[i] + x[j] == x[nxt(i)] + x[nxt(j)]) &&            (y[i] + y[j] == y[nxt(i)] + y[nxt(j)]);   }   int main() {     scanf( %lld , &n);     if (n % 2 == 1) {       printf( No n );       return 0;     }     for (register long long i = 0; i < n; i++) scanf( %lld%lld , &x[i], &y[i]);     for (register long long i = 0; i * 2 < n; i++)       if (!check(i, i + (n / 2))) {         flag = true;         break;       }     if (flag)       printf( No n );     else       printf( Yes n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long GCD(long long a, long long b) {     while (b) {       a %= b;       swap(a, b);     }     return a;   }   int main() {     int n, k, i;     long double x, y, xant, yant;     scanf( %d%d , &n, &k);     double sol = 0;     for (i = 0; i < n; i++) {       cin >> x >> y;       if (i) sol += sqrt((x - xant) * (x - xant) + (y - yant) * (y - yant));       xant = x, yant = y;     }     sol = (sol * (long double)k) / 50.0;     printf( %.9lf n , sol);     return 0;   }
#include <bits/stdc++.h>   inline int A(int x, int y) { return x && y; }   inline int O(int x, int y) { return x ^ y; }   inline int X(int x, int y) { return x || y; }   int main() {     int t1, t2, t3, t4;     scanf( %d%d%d%d , &t1, &t2, &t3, &t4);     int a1 = O(t1, t2);     int a2 = X(t3, t4);     int a3 = A(t2, t3);     int a4 = O(t1, t4);     int b1 = A(a1, a2);     int b2 = X(a3, a4);     int c1 = O(b1, b2);     printf( %d , c1);   }