malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using ii = std::pair<int, int>;   bool visited[50001];   int nexts[50001];   int value[50001];   int n, start, x;   void input() {     for (int i = 1; i <= n; i++) {       scanf( %d %d , &value[i], &nexts[i]);     }   }   ii query(int pos) {     visited[pos] = true;     printf( ? %d n , pos);     fflush(stdout);     ii res;     scanf( %d %d , &res.first, &res.second);     return res;   }   int main() {     srand(time(nullptr));     scanf( %d %d %d , &n, &start, &x);     ii max = query(start);     if (max.first >= x) {       printf( ! %d n , max.first);       fflush(stdout);       return 0;     }     std::vector<int> pick;     for (int i = 1; i <= n; i++) {       if (i == start) continue;       pick.push_back(i);     }     std::random_shuffle(pick.begin(), pick.end());     for (int i = 0; i < std::min(n - 1, 1000); i++) {       auto q = query(pick[i]);       if (q.first < x && q.first > max.first) max = q;     }     if (max.second == -1) {       printf( ! -1 n );       fflush(stdout);       return 0;     }     for (int i = 0; i < 1000; i++) {       auto q = query(max.second);       if (q.first >= x) {         printf( ! %d n , q.first);         fflush(stdout);         return 0;       } else if (q.second == -1) {         printf( ! -1 n );         fflush(stdout);         return 0;       } else {         max = q;       }     }     while (true)       ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s, s1, s2;     cin >> s;     s1 = s;     sort(s1.begin(), s1.end());     s2 += s1[0];     for (int i = 1; i < s1.length(); i++) {       if (s1[i] != s1[i - 1]) s2 += s1[i];     }     int d = 0;     for (int j = s2.length() - 1; j >= 0; j--) {       for (int i = d; i < s.length(); i++) {         if (s2[j] == s[i]) cout << s[i], d = i + 1;       }     }     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int int_inf = 0x7fffffff;   const long long ll_inf = ~(1ll << 63);   const double eps = 1e-7;   char *p1, *p2, buf[1 << 20];   inline int read() {     int f = 1, x = 0;     char ch;     while (!isdigit(         ch = (p1 == p2 &&                       (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)                   ? EOF                   : *p1++)))       if (ch ==  - ) f = -1;     x = ch -  0 ;     while (isdigit(         ch = (p1 == p2 &&                       (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)                   ? EOF                   : *p1++)))       x = x * 10 + ch -  0 ;     return x * f;   }   const int N = 1e6 + 10;   unordered_map<long long, int> m;   long long sa[N], sb[N];   int a[N], b[N], s[N], n;   int main() {     n = read();     for (int i = 1; i <= n; i++) a[i] = read(), sa[i] = sa[i - 1] + a[i];     for (int i = 1; i <= n; i++) b[i] = read(), sb[i] = sb[i - 1] + b[i];     m[0] = 0;     for (int i = 1; i <= n; i++) {       int p = s[i - 1];       while (sb[p] <= sa[i] && p <= n) p++;       s[i] = p - 1;       long long delt = sa[i] - sb[p - 1];       if (m.count(delt)) {         int x = m[delt];         cout << (i - x) << endl;         for (int j = x + 1; j <= i; j++) cout << j <<    ;         cout << endl;         cout << (s[i] - s[x]) << endl;         for (int j = s[x] + 1; j <= s[i]; j++) cout << j <<    ;         return 0;       }       m[delt] = i;     }     cout << -1;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int read() {     int x = 0;     char ch = getchar();     while (!isdigit(ch)) ch = getchar();     while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^  0 ), ch = getchar();     return x;   }   const int N = 1e7 + 5;   const long long mod = 998244353;   int ksm(int a, int b) {     int ans = 1;     while (b) {       if (b & 1) ans = 1ll * ans * a % mod;       a = 1ll * a * a % mod;       b >>= 1;     }     return ans;   }   int prime[N], kth[N], cnt;   bool is_not_prime[N];   void sieve(int n, int k) {     is_not_prime[0] = is_not_prime[1] = 1;     kth[1] = 1;     for (int i = 2; i <= n; i++) {       if (!is_not_prime[i]) prime[++cnt] = i, kth[i] = ksm(i, k);       for (int j = 1; j <= cnt && 1ll * prime[j] * i <= n; j++) {         if (i % prime[j] == 0) break;         prime[i * prime[j]] = 1;         kth[i * prime[j]] = 1ll * kth[i] * kth[prime[j]] % mod;       }     }   }   int inv[N];   void preinv(int n) {     inv[1] = 1;     for (int i = 2; i <= n; i++)       inv[i] = 1ll * inv[mod % i] * (mod - mod / i) % mod;   }   long long n, m, k, p, q, ivq, ivp;   int S[N];   int main() {     n = read(), m = read(), k = read();     sieve(k, k);     p = ksm(m, mod - 2), q = (1 - p + mod) % mod, ivq = ksm(q, mod - 2),     ivp = ksm(p, mod - 2);     preinv(k);     if (m == 1)       printf( %d n , ksm(n, k));     else if (n <= k) {       long long ans = 0;       for (int i = 0, xs1 = 1, xs2 = ksm(q, n), xs3 = 1, xs4 = 1; i <= n; i++,                xs1 = 1ll * xs1 * p % mod, xs2 = 1ll * xs2 * ivq % mod,                xs3 = 1ll * xs3 * (n - i + 1) % mod,                xs4 = 1ll * xs4 * inv[i] % mod)         ans =             (ans + 1ll * xs3 * xs4 % mod * kth[i] % mod * xs1 % mod * xs2 % mod) %             mod;       cout << ans;     } else {       S[k] = 1;       for (int i = k - 1, xs1 = mod - p,                xs2 = 1ll * (n - i - 1) * inv[k - i] % mod;            i >= 0; i--, xs1 = 1ll * xs1 * (mod - p) % mod,                xs2 = 1ll * xs2 * (n - i - 1) % mod * inv[k - i] % mod)         S[i] =             (1ll * S[i + 1] * (1 - p + mod) % mod + 1ll * xs2 * xs1 % mod) % mod;       long long ans = 0;       for (int i = 0, xs1 = 1, xs2 = 1; i <= k; i++,                xs1 = 1ll * xs1 * (n - i + 1) % mod * inv[i] % mod,                xs2 = 1ll * xs2 * p % mod)         ans = (ans + 1ll * kth[i] * xs1 % mod * S[i] % mod * xs2 % mod) % mod;       cout << ans;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s;     cin >> s;     set<char> ss;     map<string, bool> mp;     long long l = 0;     for (long long i = 0; i < s.size(); i++) {       if (!mp[s]) l++;       mp[s] = true;       rotate(s.begin(), s.end() - 1, s.end());     }     cout << l << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1100000;   int p[MAXN], f[MAXN], g[MAXN];   int main() {     int n;     scanf( %d , &n);     f[1] = 1, g[1] = 0;     for (int i = 2; i <= n + 1; i++) {       scanf( %d , &p[i]);       f[i] = 1, g[i] = 0;       for (int v = i; v != 1; v = p[v]) {         int tmp = f[p[v]];         if (f[v] > g[p[v]])           f[p[v]] = g[p[v]] = f[v];         else           f[p[v]] = max(f[p[v]], f[v] + 1);         if (f[p[v]] == tmp) break;       }       printf( %d  , g[1]);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     long long n, x;     cin >> n >> x;     string s;     cin >> s;     for (int j = 0; j < x; j++) {       for (int i = 0; i < n - 1; i++) {         if (s[i] ==  B  && s[i + 1] ==  G ) {           s[i] =  G ;           s[i + 1] =  B ;           i++;         }       }     }     cout << s <<   n ;     return 0;   }
#include<bits/stdc++.h>   using namespace std;   typedef long long ll;   typedef unsigned long long ull;   #define pii pair<int,int>   #define fi first   #define se second   #define mp make_pair   #define poly vector<ll>   #define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)   #define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)   #define pb push_back   inline ll read(){    ll x=0; char ch=getchar(); bool d=1;    for(;!isdigit(ch);ch=getchar()) if(ch== - ) d=0;    for(;isdigit(ch);ch=getchar()) x=x*10+ch- 0 ;    return d?x:-x;   }   inline ull rnd(){    return ((ull)rand()<<30^rand())<<4|rand()%4;   }   const int N=1e5+5;   map<pii,bool> used;   map<int,int> id;   set<int> S;   poly v[N<<1],rv;   bool ans[N];   int q[N];   int main(){    int n=read(),m=read(),cnt=1;    used[mp(0,0)]=1; id[0]=1; rv.pb(0); v[1].pb(0);    For(i,1,n){     int x=read(),y=read();     if(!id[x]) id[x]=++cnt,rv.pb(x);     used[mp(x,y)]=1; v[id[x]].pb(y);    }    For(i,1,m){     int x=read(),y=read(); q[i]=y;     if(used[mp(x,y)]) continue;     if(!id[x]) id[x]=++cnt,rv.pb(x);     v[id[x]].pb(-i);    }    sort(rv.begin(),rv.end());    int pre=-1,ssw=0;    for(auto o:rv){     for(int i=pre+1;i<o;){      while(S.find(ssw)!=S.end()) ssw++;      auto ksg=S.upper_bound(ssw);      if(ksg==S.end()){       ssw+=o-i; break;      }      int t=min(*ksg-ssw,(int)o-i);      ssw+=t; i+=t;     }     int pos=id[o],mn=0x3f3f3f3f;     sort(v[pos].begin(),v[pos].end());     for(auto x:v[pos]) if(x>=0){      mn=x; break;     }     while(S.find(ssw)!=S.end()) ssw++;     if(ssw<mn) S.insert(ssw); mn=min(mn,ssw);     for(auto x:v[pos]){      if(x>=0) S.insert(x);      else ans[-x]=(q[-x]!=mn);     }     pre=o;    }    For(i,1,m) puts(ans[i]? WIN : LOSE );   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s;     cin >> s;     int x = 0, y = 0;     for (int i = 0; i < s.size(); i++) {       x = x % 4;       y = y % 4;       if (s[i] ==  0 ) {         cout << 3 <<     << y + 1 << endl;         y++;       } else {         cout << 1 <<     << x + 1 << endl;         x += 2;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     srand(time(NULL));     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       unordered_map<string, int> codes;       vector<string> v(n);       for (int i = 0; i < n; i++) {         string x;         cin >> x;         v[i] = x;         codes[x]++;       }       int ans = 0;       vector<string> anss;       for (int i = 0; i < n; i++) {         if (codes[v[i]] > 1) {           ans++;           string x = v[i];           while (codes[x] >= 1) {             x = v[i];             int pos = rand() % 4;             char digit = (char)( 0  + (rand() % 10));             x[pos] = digit;           }           codes[x] = 1;           codes[v[i]]--;           anss.push_back(x);         } else           anss.push_back(v[i]);       }       cout << ans <<   n ;       for (auto a : anss) cout << a <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double x, y, R, r, eps = 0.000001;   int a, b;   int main() {     scanf( %lf , &r);     for (a = 1; a < 11; a++)       for (b = 1; b < 11; b++) {         x = (double)a / 2;         y = (double)b;         R = sqrt(x * x + y * y);         if (abs((double)a / 2 * (double)b / R - r) < eps) {           printf( %d %d n , a, b);           return 0;         }       }   }
#include <bits/stdc++.h>   using namespace std;   int n, m, l, r, a[100100], L[100100], R[100100];   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; ++i) scanf( %d , &a[i]);     for (int i = 1; i <= n; ++i)       if (a[i] > a[i - 1])         L[i] = i;       else         L[i] = L[i - 1];     for (int i = n; i >= 1; --i)       if (a[i] > a[i + 1])         R[i] = i;       else         R[i] = R[i + 1];     while (m--) {       scanf( %d%d , &l, &r);       if (R[l] >= L[r])         puts( Yes );       else         puts( No );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string a, b;   int ans = 0;   vector<int> A, B;   string cp(string s, int n) {     string ans = s;     for (int i = 1; i < n; i++) ans += s;     return ans;   }   int main() {     cin >> a >> b;     for (int i = 1; i <= a.size(); i++)       if (a.size() % i == 0 && cp(a.substr(0, i), a.size() / i) == a)         A.push_back(i);     for (int i = 1; i <= b.size(); i++)       if (b.size() % i == 0 && cp(b.substr(0, i), b.size() / i) == b)         B.push_back(i);     for (int i = 0; i < A.size(); i++)       for (int j = 0; j < B.size(); j++)         if (A[i] == B[j] && a.substr(0, A[i]) == b.substr(0, B[j])) ans++;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   static const int MAXN = 5004;   static const int ALPHA = 26;   static const int MODULUS = 1e9 + 7;   int n;   char s[MAXN];   int binom[MAXN][MAXN];   int f[MAXN][ALPHA] = {{0}}, f_rowsum[MAXN] = {0};   void preprocess_binomials() {     binom[0][0] = 1;     for (int i = 1; i < MAXN; ++i) {       binom[i][0] = 1;       for (int j = 1; j <= i; ++j)         binom[i][j] = (binom[i - 1][j - 1] + binom[i - 1][j]) % MODULUS;     }   }   int main() {     preprocess_binomials();     scanf( %d , &n);     getchar();     for (int i = 0; i < n; ++i) s[i] = getchar() -  a ;     f_rowsum[0] = 1;     for (int i = 0; i < n; ++i) {       for (int len = i + 1; len >= 1; --len) {         int increment =             ((f_rowsum[len - 1] - f[len - 1][s[i]] - f[len][s[i]]) % MODULUS +              MODULUS) %             MODULUS;         (f[len][s[i]] += increment) %= MODULUS;         (f_rowsum[len] += increment) %= MODULUS;       }     }     int ans = 0;     for (int i = 1; i <= n; ++i)       for (int j = 0; j < ALPHA; ++j)         ans =             ((long long)ans + (long long)f[i][j] * binom[n - 1][i - 1]) % MODULUS;     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   std::vector<long long> prime;   unsigned long long int power(unsigned long long int x, unsigned long long int y,                                unsigned long long int mod) {     unsigned long long int res = 1;     while (y) {       if (y & 1) res = res * x % mod;       x = x * x % mod;       y >>= 1;     }     return res;   }   bool miller(unsigned long long int x, unsigned long long int d) {     unsigned long long int a = rand() % (x - 1) + 2;     unsigned long long int ad = power(a, d, x);     if (ad == 1 || ad == x - 1) {       return true;     }     while (d != x - 1) {       ad = ad * ad % x;       if (ad == 1) {         return false;       }       if (ad == x - 1) {         return true;       }       d *= 2;     }     return false;   }   bool primer(unsigned long long int x) {     if (x == 2 || x == 3 || x == 5 || x == 7) return true;     if (x % 2 == 0 || x == 1) return false;     unsigned long long int d = x - 1;     while (d % 2 == 0) d = d / 2;     for (int i = 0; i < 7; ++i) {       if (!miller(x, d)) {         return false;       }     }     return true;   }   bool isp(long long n) {     if (n == 1) {       return false;     }     for (int i = 2; i <= sqrt(n); i++) {       if (!n % 2) {         return false;       }     }     return true;   }   int nearestprime(unsigned long long int x) {     unsigned long long int i;     for (i = x; !primer(i); i--)       ;     return i;   }   set<pair<int, int> > st;   int main() {     ios::sync_with_stdio(false);     int n, k, c, p;     int tsize[1000 + 45];     pair<int, pair<int, int> > price[1000 + 45];     bool occ[1000 + 45];     for (int i = 0; i <= 1000; i++) {       occ[i] = false;     }     vector<pair<int, int> > ans;     pair<int, int> table[1000 + 45];     cin >> n;     for (int i = 0; i < n; i++) {       cin >> c >> p;       price[i].first = p;       price[i].second.first = INT_MAX - c;       price[i].second.second = i;     }     cin >> k;     for (int i = 0; i < k; i++) {       cin >> table[i].first;       table[i].second = i;     }     pair<int, int> *it;     sort(price, price + n);     sort(table, table + k);     table[k].first = INT_MAX;     table[k].second = INT_MAX;     long long sum = 0;     int cnt = 0;     for (int i = n - 1; i >= 0; i--) {       it = lower_bound(table, table + k,                        make_pair(INT_MAX - price[i].second.first, -1));       if (it->first == INT_MAX) {         continue;       } else {         bool flag = true;         while (occ[it->second] == true) {           it++;           if (it->first == INT_MAX) {             flag = false;             break;           }         }         if (flag == true) {           occ[it->second] = true;           sum += price[i].first;           cnt++;           ans.push_back(make_pair(price[i].second.second, it->second));         }       }     }     cout << cnt <<     << sum <<   n ;     sort(ans.begin(), ans.end());     for (int i = 0; i < ans.size(); i++) {       cout << ans[i].first + 1 <<     << ans[i].second + 1 <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   inline T qmin(const T &x, const T &y) {     return x < y ? x : y;   }   template <typename T>   inline T qmax(const T &x, const T &y) {     return x > y ? x : y;   }   template <typename T>   inline void getmin(T &x, const T &y) {     if (y < x) x = y;   }   template <typename T>   inline void getmax(T &x, const T &y) {     if (y > x) x = y;   }   inline void fileio(string s) {     freopen((s +  .in ).c_str(),  r , stdin);     freopen((s +  .out ).c_str(),  w , stdout);   }   const int inf = (int)1e9 + 7;   const long long linf = (long long)1e17 + 7;   const int N = 1e5 + 7, Node = N << 2;   int to[Node][10];   long long val[Node][10];   int n, q, a[N];   inline void merge(int u) {     for (int i = 0; i < (10); ++i) val[u][i] = 0;     for (int i = 0; i < (10); ++i) {       val[u][to[((u) << 1)][i]] += val[((u) << 1)][i];       val[u][to[((u) << 1 ^ 1)][i]] += val[((u) << 1 ^ 1)][i];     }   }   inline void psd(int u) {     for (int i = 0; i < (10); ++i) {       to[((u) << 1)][i] = to[u][to[((u) << 1)][i]];       to[((u) << 1 ^ 1)][i] = to[u][to[((u) << 1 ^ 1)][i]];     }     for (int i = 0; i < (10); ++i) to[u][i] = i;   }   inline void init(int u, int l, int r) {     for (int i = 0; i < (10); ++i) to[u][i] = i;     if (l == r) {       for (int v = a[l], w = 1; v; v /= 10, w *= 10) val[u][v % 10] += w;     } else {       int mid = l + r >> 1;       init(((u) << 1), l, mid);       init(((u) << 1 ^ 1), mid + 1, r);       merge(u);     }   }   inline void change(int u, int l, int r, int l1, int r1, int x, int y) {     if (l1 <= l && r <= r1) {       for (int i = 0; i < (10); ++i)         if (to[u][i] == x) to[u][i] = y;     } else {       psd(u);       int mid = l + r >> 1;       if (l1 <= mid) change(((u) << 1), l, mid, l1, r1, x, y);       if (r1 > mid) change(((u) << 1 ^ 1), mid + 1, r, l1, r1, x, y);       merge(u);     }   }   inline long long getans(int u, int l, int r, int l1, int r1) {     long long ans = 0;     if (l1 <= l && r <= r1) {       for (int i = 0; i < (10); ++i) ans += to[u][i] * val[u][i];     } else {       psd(u);       int mid = l + r >> 1;       if (l1 <= mid) ans += getans(((u) << 1), l, mid, l1, r1);       if (r1 > mid) ans += getans(((u) << 1 ^ 1), mid + 1, r, l1, r1);       merge(u);     }     return ans;   }   int main() {     scanf( %d%d , &n, &q);     for (int i = (1); i <= (n); ++i) scanf( %d , a + i);     init(1, 1, n);     while (q--) {       int type, l, r, x, y;       scanf( %d%d%d , &type, &l, &r);       if (type == 1) {         scanf( %d%d , &x, &y);         change(1, 1, n, l, r, x, y);       } else {         printf( %lld n , getans(1, 1, n, l, r));       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     vector<vector<int>> moves(2, vector<int>());     for (int i = 0; i < 2; ++i) {       int k;       cin >> k;       for (int j = 0; j < k; ++j) {         int m;         cin >> m;         moves[i].push_back(m);       }     }     queue<std::pair<int, int>> q;     q.push({0, 0});     q.push({0, 1});     vector<vector<int>> res(n, vector<int>(2, -1));     res[0][0] = 0;     res[0][1] = 0;     vector<vector<int>> counter(n, vector<int>(2, 0));     while (!q.empty()) {       std::pair<int, int> v = q.front();       q.pop();       int pos = v.first;       int player = v.second;       if (res[pos][player] == 0) {         for (const auto& m : moves[1 ^ player]) {           int k = pos - m;           if (k < 0) {             k += n;           }           if (res[k][1 ^ player] == -1) {             res[k][1 ^ player] = 1;             q.push({k, 1 ^ player});           }         }       } else {         for (const auto& m : moves[1 ^ player]) {           int k = pos - m;           if (k < 0) {             k += n;           }           if (res[k][1 ^ player] == -1) {             ++counter[k][1 ^ player];             if (counter[k][1 ^ player] == (int)moves[1 ^ player].size()) {               res[k][1 ^ player] = 0;               q.push({k, 1 ^ player});             }           }         }       }     }     for (int i = 0; i < 2; ++i) {       for (int j = 1; j < n; ++j) {         if (res[j][i] == 0) {           cout <<  Lose  ;         } else if (res[j][i] == 1) {           cout <<  Win  ;         } else {           cout <<  Loop  ;         }       }       cout << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 10;   int a[maxn], b[maxn];   int p[maxn];   int main() {     int n;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);     }     memset(p, 0, sizeof(p));     for (int i = 1; i <= n; i++) {       scanf( %d , &b[i]);       p[b[i]] = i;     }     if (p[1]) {       for (int i = 1; p[i] == p[1] + i - 1; i++) {         if (p[i] == n) {           int k = i + 1;           for (; k <= n && p[k] <= k - i - 1; k++)             ;           if (k > n) {             printf( %d n , n - i);             return 0;           }         }       }     }     int ans = 0;     for (int i = 1; i <= n; i++) {       ans = max(ans, p[i] - i + 1 + n);     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int inf = 2e9;   struct point {     int x, y, id;     point operator-(const point &a) const {       point res;       res.x = x - a.x;       res.y = y - a.y;       return res;     }     int operator*(const point &a) const { return x * a.y - y * a.x; }   } p[100010], o;   int dis(point x, point y) {     return (x.x - y.x) * (x.x - y.x) + (x.y - y.y) * (x.y - y.y);   }   int qua(point x) {     if (x.x > 0 && x.y >= 0) {       return 1;     }     if (x.x <= 0 && x.y > 0) {       return 2;     }     if (x.x < 0 && x.y <= 0) {       return 3;     }     if (x.x >= 0 && x.y < 0) {       return 4;     }   }   bool cmp(point x, point y) {     if (fabs(atan2(x.y, x.x) - atan2(y.y, y.x)) > 0.1) {       return atan2(x.y, x.x) < atan2(y.y, y.x);     }     int tmp = (x - o) * (y - o);     if (tmp == 0) {       return dis(x, o) < dis(y, o);     } else {       return tmp > 0;     }   }   point Div(point x, point y) {     point res;     res.x = x.x * y.x + x.y * y.y;     res.y = x.y * y.x - x.x * y.y;     return res;   }   int n, ans, ansa = 1, ansb = -inf;   bool upd(int a, int b) {     if (1LL * a * ansb < 1LL * ansa * b) {       ansa = a;       ansb = b;       return true;     } else {       return false;     }   }   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %d%d , &p[i].x, &p[i].y);       p[i].id = i + 1;     }     sort(p, p + n, cmp);     p[n] = p[0];     for (int i = 0; i < n; i++) {       point x = Div(p[i], p[i + 1]);       if (x.y < 0) {         x.y = -x.y;       }       if (upd(x.y, x.x)) {         ans = i;       }     }     printf( %d %d n , p[ans].id, p[ans + 1].id);     return 0;   }