malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   void solve() {     long long int x, y;     cin >> x >> y;     if (x == 1) {       if (y <= 1) {         cout <<  yes  << endl;         return;       } else {         cout <<  no  << endl;         return;       }     } else if (x == 2 || x == 3) {       if (y <= 3) {         cout <<  yes  << endl;         return;       } else {         cout <<  no  << endl;         return;       }     } else if (x > 3) {       cout <<  yes  << endl;       return;     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long int q;     cin >> q;     while (q--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct Bitset {     int sz, len;     vector<unsigned int> v;     Bitset(int szz) {       len = szz;       sz = szz + 31 >> 5;       v.clear();       v.resize(sz, 0);     }     Bitset operator<<=(int x) {       int d = x >> 5, r = x & 31;       for (int i = sz - 1; i >= d; i--) v[i] = v[i - d];       for (int i = d - 1; i >= 0; i--) v[i] = 0;       if (r) {         for (int i = sz - 1; i >= 1; i--)           v[i] = ((v[i] & ((1u << 32 - r) - 1)) << r) | (v[i - 1] >> 32 - r);         v[0] = (v[0] & ((1u << 32 - r) - 1)) << r;       }     }     Bitset operator|(const Bitset &b) {       Bitset rlt = Bitset(len);       for (int i = 0; i < sz; i++) rlt.v[i] = v[i] | b.v[i];       return rlt;     }     Bitset operator^(const Bitset &b) {       Bitset rlt = Bitset(len);       for (int i = 0; i < sz; i++) rlt.v[i] = v[i] ^ b.v[i];       return rlt;     }     vector<int> get() {       vector<int> rlt;       for (int i = 0; i < sz; i++)         if (v[i]) {           for (int j = 0; j < 32; j++)             if (v[i] & (1u << j)) rlt.push_back((i << 5) | j);         }       return rlt;     }     bool bit(int x) { return v[x >> 5] & (1u << (x & 31)); }   };   int n, s, a[70707], id[70707], in[70707];   bool vis[70707];   set<int> st[70707];   bool cmp(int i, int j) {     return a[i] != a[j] ? a[i] < a[j] : !vis[i] && vis[j];   }   int main() {     Bitset val = Bitset(70707), nwb = Bitset(70707), tmp = Bitset(70707);     scanf( %d %d , &n, &s);     int I = 0;     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       if (a[i] > s) return puts( -1 ), 0;       if (a[i] > a[I]) I = i;     }     vis[I] = 1;     s -= a[I];     val.v[0] = 1;     for (int i = 1; i <= n && s; i++)       if (!vis[i] && a[i] <= s) {         tmp = val;         tmp <<= a[i];         nwb = val ^ (val | tmp);         val = val | tmp;         vector<int> v = nwb.get();         for (int j = 0; j < v.size(); j++) {           if (v[j] <= s) st[i].insert(v[j]);         }       }     if (!val.bit(s)) return puts( -1 ), 0;     for (int i = n; i >= 1; i--) {       if (st[i].find(s) != st[i].end()) {         s -= a[i];         vis[i] = 1;       }     }     for (int i = 1; i <= n; i++) id[i] = i;     sort(id + 1, id + n + 1, cmp);     for (int i = 1; i <= n; i++) {       if (!vis[id[i]]) {         in[id[i + 1]] = id[i];       }     }     for (int i = 1; i <= n; i++) {       printf( %d  , a[i] - a[in[i]]);       if (in[i])         printf( 1 %d n , in[i]);       else         puts( 0 );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, t, i, j, k;   long long a[2000005];   long long ans, sum;   int main() {     scanf( %d%d , &n, &m);     for (i = 1; i <= m * 2; i++) {       scanf( %d , &t);       a[t]++;     }     for (i = 1; i <= n; i++) ans += a[i] * (n - 1 - a[i]);     printf( %lld n , (long long)n * (n - 1) * (n - 2) / 6 - ans / 2);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int mat[1010][1010];   int main() {     int n, a, b;     cin >> n >> a >> b;     if (a > 1 && b > 1) {       puts( NO );       return (0);     }     if (n > 1 && n <= 3 && a == 1 && b == 1) {       puts( NO );       return (0);     }     puts( YES );     if (a == 1 && b == 1) {       for (int i = 1; i < n; i++) {         mat[i][i + 1] = 1;         mat[i + 1][i] = 1;       }     } else if (a == 1) {       for (int i = 1; i < b; i++) {         for (int j = 1; j <= n; j++) {           if (i != j) {             mat[i][j] = 1;             mat[j][i] = 1;           }         }       }     } else if (b == 1) {       for (int i = a; i < n; i++) {         mat[i][i + 1] = 1;         mat[i + 1][i] = 1;       }     }     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= n; j++) printf( %d , mat[i][j]);       printf(  n );     }     return (0);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long T, n, k;     cin >> T;     while (T--) {       cin >> n >> k;       long long ans = 0;       while (n) {         if (n % k != 0)           ans += n % k, n -= n % k;         else           ans++, n /= k;       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int arr[100][100];   int row[100];   vector<pair<pair<int, int>, pair<int, int> > > v;   int pos[30000][2];   int main() {     int n;     int sum = 0;     while (scanf(  %d , &n) == 1) {       v.clear();       sum = 0;       for (int i = 1; i <= n; i++) scanf(  %d , &row[i]);       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= row[i]; j++) {           scanf(  %d , &arr[i][j]);           pos[arr[i][j]][0] = i;           pos[arr[i][j]][1] = j;         }         sum += row[i];       }       int cnt = 1;       int swcnt = 0;       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= row[i]; j++) {           if (arr[i][j] != cnt) {             swcnt++;             int r = pos[cnt][0];             int c = pos[cnt][1];             int val = arr[i][j];             arr[i][j] = cnt;             arr[r][c] = val;             pos[val][0] = r;             pos[val][1] = c;             pos[cnt][0] = i;             pos[cnt][1] = j;             v.push_back(make_pair(make_pair(i, j), make_pair(r, c)));           }           cnt++;         }       }       printf( %d n , swcnt);       for (int i = 0; i < ((int)v.size()); i++)         printf( %d %d %d %d n , v[i].first.first, v[i].first.second,                v[i].second.first, v[i].second.second);     }   }
#include <bits/stdc++.h>   using namespace std;   int n, a[3];   int dp[310][310];   string name[2] = { BitAryo ,  BitLGM };   int mem(int x, int y) {     if (dp[x][y] != -1) return dp[x][y];     int mn = 1;     for (int i = 1; i <= x; i++) mn = min(mn, mem(x - i, y));     for (int i = 1; i <= y; i++) mn = min(mn, mem(x, y - i));     for (int i = 1; i <= min(x, y); i++) mn = min(mn, mem(x - i, y - i));     return dp[x][y] = 1 - mn;   }   int main() {     memset(dp, -1, sizeof dp);     cin >> n;     for (int i = 0; i < n; i++) cin >> a[i];     if (n == 1) cout << name[(a[0] == 0 ? 0 : 1)] << endl;     if (n == 2) cout << name[mem(a[0], a[1])] << endl;     if (n == 3) cout << name[((a[0] ^ a[1] ^ a[2]) == 0 ? 0 : 1)] << endl;     return 0;   }
#include <bits/stdc++.h>   struct Point {     double x, y;   };   struct Polygon {     Point p[100000];     int n;     inline double get(int i, double x) {       if (i < 0) return p[0].y;       if (i >= n - 1) return p[n - 1].y;       return p[i].y +              (x - p[i].x) * (p[i + 1].y - p[i].y) / (p[i + 1].x - p[i].x);     }     double area() {       double sum = 0;       for (int i = 0; i < n - 1; i++)         sum += (p[i + 1].x - p[i].x) * (p[i + 1].y + p[i].y) / 2;       return sum;     }   };   Polygon poly[2];   Polygon inp;   Polygon ta;   Polygon tb;   void intersect(Polygon& res, Polygon& a, Polygon& b) {     ta.n = tb.n = res.n = 0;     int ai = 0, bi = 0;     while (ai < a.n || bi < b.n) {       if (ai < a.n && (bi >= b.n || a.p[ai].x < b.p[bi].x)) {         tb.p[tb.n].x = a.p[ai].x;         tb.p[tb.n++].y = b.get(bi - 1, a.p[ai].x);         ta.p[ta.n++] = a.p[ai++];       } else {         ta.p[ta.n].x = b.p[bi].x;         ta.p[ta.n++].y = a.get(ai - 1, b.p[bi].x);         tb.p[tb.n++] = b.p[bi++];       }     }     for (int i = 0, next = 0; i < ta.n; i = next) {       while (next < ta.n && ta.p[next].x - ta.p[i].x < 1e-6) next++;       res.p[res.n].x = ta.p[i].x;       res.p[res.n++].y = (ta.p[i].y > tb.p[i].y ? ta.p[i].y : tb.p[i].y);       if (next < ta.n &&           (ta.p[i].y - tb.p[i].y) * (ta.p[next].y - tb.p[next].y) < -1e-6) {         double t = (tb.p[i].y - ta.p[i].y) /                    (ta.p[next].y - ta.p[i].y - tb.p[next].y + tb.p[i].y);         res.p[res.n].x = ta.p[i].x + t * (ta.p[next].x - ta.p[i].x);         res.p[res.n++].y = ta.p[i].y + t * (ta.p[next].y - ta.p[i].y);       }     }   }   int main() {     int n;     scanf( %d%d , &n, &inp.n);     inp.n++;     for (int i = 0; i < inp.n; i++) inp.p[i].x = i;     int cur = 0;     double prev = 0;     for (int i = 0; i < n; i++) {       for (int j = 0; j < inp.n; j++) scanf( %lf , &inp.p[j].y);       if (i == 0)         memcpy(&poly[1 - cur], &inp, sizeof inp);       else         intersect(poly[1 - cur], poly[cur], inp);       cur = 1 - cur;       double area = poly[cur].area();       printf( %lf n , area - prev);       prev = area;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct edge {     int from, to, vis, next;   } e[400020];   int top, head[200020];   vector<int> g[200020];   int in[200020], gg[200020];   int n, m, k;   int ans[200020], cnt;   void add_edge(int from, int to) {     e[++top].to = to;     e[top].from = from;     e[top].next = head[from];     head[from] = top;   }   void add(int from, int to) {     add_edge(from, to);     add_edge(to, from);   }   queue<int> q;   void del(int pos) {     if (!gg[pos]) cnt--;     q.push(pos);     gg[pos] = 1;     while (!q.empty()) {       int now = q.front();       q.pop();       for (int i = head[now]; ~i; i = e[i].next) {         if (e[i].vis || gg[e[i].to]) continue;         in[e[i].to]--;         e[i].vis = 1;         e[i ^ 1].vis = 1;         if (in[e[i].to] < k) {           cnt--;           gg[e[i].to] = 1;           q.push(e[i].to);         }       }     }   }   int main() {     scanf( %d%d%d , &n, &m, &k);     cnt = n;     top = -1;     memset(head, -1, sizeof(head));     int from, to;     for (int i = 1; i <= m; i++) {       scanf( %d%d , &from, &to);       in[from]++, in[to]++;       add(from, to);     }     for (int i = 1; i <= n; i++) {       if (head[i] == -1) cnt--, gg[i] = 1;     }     for (int i = 1; i <= n; i++) {       if (in[i] < k && !gg[i]) del(i);     }     int ttt = m;     for (int i = 2 * m - 1; i >= 1; i -= 2) {       ans[ttt--] = cnt;       if (e[i].vis) continue;       in[e[i].from]--;       in[e[i].to]--;       e[i].vis = e[i ^ 1].vis = 1;       if (!gg[e[i].from] && in[e[i].from] < k) del(e[i].from);       if (!gg[e[i].to] && in[e[i].to] < k) del(e[i].to);     }     for (int i = 1; i <= m; i++) printf( %d n , ans[i]);   }
#include <bits/stdc++.h>   using namespace std;   vector<long long> s;   vector<long long>::iterator it;   long long n, m, a;   long long sum = 0;   int main() {     cin >> n >> m;     for (long long i = 0; i < n; ++i) {       cin >> a;       s.push_back(a);       sum += a;     }     if (m > sum)       cout << -1 << endl;     else {       sort(s.begin(), s.end(), greater<long long>());       long long l = 1, r = n;       while (l <= r) {         long long mid = (l + r) / 2, ans = 0, temp = 0;         it = s.begin();         while (it != s.end()) {           long long cnt = 0;           while (cnt < mid && it != s.end()) {             ans += max((long long)0, *it - temp);             ++it, ++cnt;           }           ++temp;         }         if (ans < m)           l = mid + 1;         else           r = mid - 1;       }       cout << l << endl;     }   }
#include <bits/stdc++.h>   const double eps = (1e-9);   using namespace std;   int dcmp(long double a, long double b) {     return fabsl(a - b) <= eps ? 0 : (a > b) ? 1 : -1;   }   int getBit(long long num, int idx) { return ((num >> idx) & 1ll) == 1; }   int setBit1(int num, int idx) { return num | (1 << idx); }   long long setBit0(long long num, int idx) { return num & ~(1ll << idx); }   long long flipBit(long long num, int idx) { return num ^ (1ll << idx); }   void M() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);   }   int countNumBit1(int mask) {     int ret = 0;     while (mask) {       mask &= (mask - 1);       ++ret;     }     return ret;   }   const int N = 300009;   int arr[N], key[N], n, power[32], ans[N];   string ret;   struct trie {     trie* child[3];     int isleaf;     trie() {       isleaf = 0;       memset(child, 0, sizeof(child));     }   };   string to_bin(int n) {     string ret =   , ans =   ;     while (n) {       ret += (char)((n % 2) +  0 );       n /= 2;     }     int rem = 30 - ((int)(ret).size());     while (rem--) {       ret +=  0 ;     }     for (int i = ((int)(ret).size()) - 1; i >= 0; i--) {       ans += ret[i];     }     return ans;   }   int to_dec(string s) {     int ans = 0;     for (int i = ((int)(s).size()) - 1; i >= 0; i--) {       ans += power[((int)(s).size()) - 1 - i] * (s[i] -  0 );     }     return ans;   }   void insertt(trie* cur, int id, string s) {     if (id == ((int)(s).size())) {       cur->isleaf++;       return;     }     int ch = s[id] -  0 ;     if (cur->child[ch] == 0) {       cur->child[ch] = new trie();     }     insertt(cur->child[ch], id + 1, s);   }   bool removee(trie* cur, int id, string s) {     if (id == ((int)(s).size())) {       cur->isleaf--;       return (cur->isleaf == 0 && (cur->child[0] == 0 && cur->child[1] == 0));     }     int ch = s[id] -  0 ;     bool ret = removee(cur->child[ch], id + 1, s);     if (ret) {       cur->child[ch] = 0;       return (cur->isleaf == 0 && cur->child[0] == 0 && cur->child[1] == 0);     }     return 0;   }   void findd(trie* cur, int id, string s) {     if (id == ((int)(s).size())) {       return;     }     int ch = s[id] -  0 ;     int opch = (s[id] ==  0  ?  1  :  0 ) -  0 ;     if (cur->child[ch] != 0) {       ret += (char)(ch +  0 );       findd(cur->child[ch], id + 1, s);     } else if (cur->child[opch] != 0) {       ret += (char)(opch +  0 );       findd(cur->child[opch], id + 1, s);     }   }   int main() {     cin >> n;     for (int i = 0; i < n; i++) {       cin >> arr[i];     }     power[0] = 1;     for (int i = 1; i <= 30; i++) power[i] = power[i - 1] * 2;     trie* root = new trie();     int no;     for (int i = 0; i < n; i++) {       cin >> no;       string st = to_bin(no);       insertt(root, 0, st);     }     for (int i = 0; i < n; i++) {       string st = to_bin(arr[i]);       ret =   ;       findd(root, 0, st);       removee(root, 0, ret);       ans[i] = arr[i] ^ (to_dec(ret));     }     for (int i = 0; i < n; i++) {       cout << ans[i] <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   int log2(int x) { return 31 - __builtin_clz(x); }   int main(void) {     std::ios_base::sync_with_stdio(false);     std::cin.tie(NULL);     int n, q;     cin >> n >> q;     vector<long long> a(n);     for (int i = 0; i < (int)(n); i++) {       cin >> a[i];     }     for (int i = 0; i < (int)(n); i++) {       int b;       cin >> b;       a[i] = b - a[i];       if (i) {         a[i] += a[i - 1];       }     }     vector<vector<long long> > mn(20, vector<long long>(n)),         mx(20, vector<long long>(n));     copy(a.begin(), a.end(), mn[0].begin());     copy(a.begin(), a.end(), mx[0].begin());     for (int k = 1; k < 20; k++) {       for (int i = 0; i + (1 << (k - 1)) < n; i++) {         mn[k][i] = min(mn[k - 1][i], mn[k - 1][i + (1 << (k - 1))]);         mx[k][i] = max(mx[k - 1][i], mx[k - 1][i + (1 << (k - 1))]);       }     }     int l, r;     while (q--) {       cin >> l >> r;       --l;       int k = log2(r - l);       long long _min = min(mn[k][l], mn[k][r - (1 << k)]);       long long _max = max(mx[k][l], mx[k][r - (1 << k)]);       long long start = l ? a[l - 1] : 0;       if (start != a[r - 1] || _min < start) {         cout <<  -1 n ;       } else {         cout << _max - start <<   n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int weight[11];   int total = 0;   int bd2 = 0;   int mem[11][5001];   int m;   bool wasal = false;   int arr[1001];   int knapsack(int i, int prev, int totalPrev, int me, int all, int counter) {     arr[counter - 1] = prev;     if (i == m) {       wasal = true;       bd2 = all;       return 0;     }     int choice2 = 0;     if (!wasal) {       for (int j = 0; j < total && !wasal; j++) {         if (weight[j] != prev && me + weight[j] > totalPrev && !wasal) {           if (totalPrev == -1) {             totalPrev = 0;           }           choice2 += knapsack(i + 1, weight[j], me + weight[j], totalPrev,                               me + weight[j] + totalPrev, counter + 1) +                      1;         }       }       return choice2;     }     return 0;   }   int main() {     string c;     cin >> c;     for (int i = 0; i < c.size(); i++) {       if (c.at(i) ==  1 ) {         weight[total] = i + 1;         total++;       }     }     memset(arr, false, sizeof(arr));     cin >> m;     int num = knapsack(0, 0, -1, 0, 0, 0);     if (wasal) {       cout <<  YES  << endl;       for (int i = 0; i < m; i++) {         if (i != 0) {           cout <<     << arr[i];         } else {           cout << arr[i];         }       }     } else {       cout <<  NO  << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, m, a[100005], sum, en;   bool cheak(long long mid) {     long long sum = 0, cnt = m;     for (int i = 1; i <= n; ++i) {       if (a[i]) {         sum += a[i];         while (sum > mid - i) {           sum -= (mid - i);           cnt--;           if (cnt < 0) return 0;         }       }     }     if (!cnt) return sum <= 0;     return 1;   }   int main() {     cin >> n >> m;     for (int i = 1; i <= n; ++i) cin >> a[i];     long long l = 0, r = 1e17, ans;     while (l < r) {       long long mid = (l + r) / 2;       if (cheak(mid))         ans = mid, r = mid;       else         l = mid + 1;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n;     int a[n], i;     for (i = 0; i < n; ++i) cin >> a[i];     cin >> m;     int b[m];     for (i = 0; i < m; ++i) cin >> b[i];     sort(a, a + n, greater<int>());     sort(b, b + m, greater<int>());     cout << a[0] <<     << b[0] << endl;     return 0;   }
#include<bits/stdc++.h>   using namespace std;      #define ll long long int   #define M 1000000007      int main()   {       ios_base::sync_with_stdio(false);       cin.tie(0),cout.tie(0);       int t,n,x;       cin>>t;       string str= 2020 ;       while(t--)       {           int a,b,c,d,e,c1,c2,c3;           cin>>c1>>c2>>c3;           cin>>a>>b>>c>>d>>e;           bool flag=true;           int te=min(c1,a);           c1-=te;           a-=te;           te=min(c2,b);           c2-=te;           b-=te;           te=min(c3,c);           c3-=te;           c-=te;           te=min(c1,d);           c1-=te;           d-=te;           te=min(c2,e);           c2-=te;           e-=te;           te=min(c3,d);           c3-=te;           d-=te;           te=min(c3,e);           c3-=te;           e-=te;           if(a||b||c||d||e)               cout<< no ;           else               cout<< yes ;           cout<<endl;       }       return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n >> m;     string s[n];     for (int i = 0; i < n; i++) cin >> s[i];     vector<vector<int>> row(n), col(m);     for (int i = n - 1; i >= 0; i--) {       for (int j = 0; j < m; j++) {         if (s[i][j] ==  # ) {           row[i].push_back(j);           col[j].push_back(i);         }       }     }     deque<pair<int, int>> q;     int rw[n];     int rvis[n];     for (int i = 0; i < n; i++) {       rw[i] = INT_MAX;       rvis[i] = 0;     }     int cw[m];     int cvis[m];     for (int i = 0; i < m; i++) {       cw[i] = INT_MAX;       cvis[i] = 0;     }     rw[n - 1] = 0;     q.push_back(make_pair(0, n - 1));     while (q.size() > 0) {       int type = q.front().first;       int num = q.front().second;       q.pop_front();       if (type == 0) {         if (rvis[num] == 1)           continue;         else           rvis[num] = 1;         if (num == 0) break;         for (int i = 0; i < row[num].size(); i++) {           int cn = row[num][i];           if (cvis[cn] == 0 && cw[cn] > rw[num] + 1) {             cw[cn] = rw[num] + 1;             q.push_back(make_pair(1, cn));           }         }       } else if (type == 1) {         if (cvis[num] == 1)           continue;         else           cvis[num] = 1;         for (int i = 0; i < col[num].size(); i++) {           int rn = col[num][i];           if (rvis[rn] == 0 && rw[rn] > cw[num] + 1) {             rw[rn] = cw[num] + 1;             q.push_back(make_pair(0, rn));           }         }       }     }     if (rw[0] == INT_MAX)       cout << -1;     else       cout << rw[0];   }
#include <bits/stdc++.h>   using namespace std;   class Solution {    public:     long long maximize(vector<int>& nums, int x) {       int n = nums.size();       vector<vector<long long>> dp(3, vector<long long>(n + 1, 0));       long long res = 0;       for (int i = 0; i < n; ++i) {         long long num = nums[i];         dp[0][i + 1] = max(0LL, dp[0][i] + num);         dp[1][i + 1] = max(0LL, max(dp[0][i], dp[1][i]) + num * x);         dp[2][i + 1] = max(0LL, max(dp[2][i], dp[1][i]) + num);       }       for (int j = 0; j < 3; ++j) {         for (int i = 0; i <= n; ++i) {           res = max(res, dp[j][i]);         }       }       return res;     }   };   int main(int argc, char** argv) {     ios::sync_with_stdio(false);     cin.tie(0);     Solution sol;     int n, x;     cin >> n >> x;     vector<int> nums(n);     for (int i = 0; i < n; ++i) {       cin >> nums[i];     }     cout << sol.maximize(nums, x) <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double eps = 1e-8;   int main() {     int i, n, sum;     while (scanf( %d , &n) != EOF) {       sum = 0;       while (n != 1) {         sum += n;         for (i = 2; i <= n; i++) {           if (n % i == 0) {             n /= i;             break;           }         }       }       cout << sum + 1 << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long xa, ya, xb, yb, xc, yc, a, A;     cin >> xa >> ya >> xb >> yb >> xc >> yc;     if ((xa == xb) && (ya == yb))       cout <<  YES ;     else if ((xb == ya) && (yb == -xa))       cout <<  YES ;     else if ((xb == -xa) && (yb == -ya))       cout <<  YES ;     else if ((xb == -ya) && (yb == xa))       cout <<  YES ;     else if (((xc * xc) + (yc * yc)) == 0)       cout <<  NO ;     else {       A = (xc * xc) + (yc * yc);       a = (((xb - xa) * xc) + ((yb - ya) * yc));       if (a % A == 0) {         a = a / A;         if ((yc != 0) && ((xb - xa - (xc * a)) % yc == 0)) {           cout <<  YES ;           return 0;         } else if ((xc != 0) && ((yb - ya - (yc * a)) % xc == 0)) {           cout <<  YES ;           return 0;         }       }       a = (((xb + ya) * xc) + ((yb - xa) * yc));       if (a % A == 0) {         a = a / A;         if ((yc != 0) && ((xb + ya - (xc * a)) % yc == 0)) {           cout <<  YES ;           return 0;         } else if ((xc != 0) && ((yb - xa - (yc * a)) % xc == 0)) {           cout <<  YES ;           return 0;         }       }       a = (((xb + xa) * xc) + ((yb + ya) * yc));       if (a % A == 0) {         a = a / A;         if ((yc != 0) && ((xb + xa - (xc * a)) % yc == 0)) {           cout <<  YES ;           return 0;         } else if ((xc != 0) && ((yb + ya - (yc * a)) % xc == 0)) {           cout <<  YES ;           return 0;         }       }       a = (((xb - ya) * xc) + ((yb + xa) * yc));       if (a % A == 0) {         a = a / A;         if ((yc != 0) && ((xb - ya - (xc * a)) % yc == 0)) {           cout <<  YES ;           return 0;         } else if ((xc != 0) && ((yb + xa - (yc * a)) % xc == 0)) {           cout <<  YES ;           return 0;         }       }       cout <<  NO ;     }     return 0;   }