func_code_string: #include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }   long long power(long long x, long long y, long long p) {     long long res = 1;     x = x % p;     while (y > 0) {       if (y & 1) res = ((res % p) * (x % p)) % p;       y = y >> 1;       x = ((x % p) * (x % p)) % p;     }     return res;   }   long long raichu(long long x, long long y) {     long long res = 1;     while (y > 0) {       if (y & 1) res = ((res) * (x));       y = y >> 1;       x = ((x) * (x));     }     return res;   }   bool isprime(long long n) {     if (n < 2)       return false;     else if (n == 2)       return true;     else if (n % 2 == 0)       return false;     else {       long long z = sqrt(n);       for (int i = 0; i < z - 1; i++)         if (n % (i + 2) == 0) return false;       return true;     }   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int t = 1, T;     T = t;     while (t--) {       int n;       cin >> n;       vector<pair<int, int> > kb(n);       vector<pair<pair<long double, int>, int> > v;       vector<pair<long double, int> > minus, plus;       vector<pair<long long, long long> > lines;       long long K = 0, B = 0;       for (int i = 0; i < n; i++) {         cin >> kb[i].first >> kb[i].second;         if (kb[i].first == 0 && kb[i].second == 0)           continue;         else if (kb[i].first == 0) {           if (kb[i].second > 0)             B += kb[i].second;           else             continue;         } else if (kb[i].second == 0) {           if (kb[i].first > 0)             v.push_back(make_pair(make_pair(0, 1), i));           else             v.push_back(make_pair(make_pair(0, -1), i));         } else {           if (kb[i].first > 0)             v.push_back(                 make_pair(make_pair((-1.0 * kb[i].second) / kb[i].first, 1), i));           else             v.push_back(                 make_pair(make_pair((-1.0 * kb[i].second) / kb[i].first, -1), i));         }       }       n = (int)v.size();       int ans = 0;       sort(v.begin(), v.end());       for (int i = 0; i < n; i++) {         if (v[i].first.second == -1) {           K += kb[v[i].second].first;           B += kb[v[i].second].second;         }       }       lines.push_back(make_pair(K, B));       for (int i = 0; i < n; i++) {         long double x = v[i].first.first;         while (i < n && v[i].first.first == x) {           if (v[i].first.second == 1) {             K += kb[v[i].second].first;             B += kb[v[i].second].second;           } else {             K -= kb[v[i].second].first;             B -= kb[v[i].second].second;           }           i++;         }         i--;         lines.push_back(make_pair(K, B));       }       for (int i = 0; i < (int)lines.size() - 1; i++) {         if (lines[i].first != lines[i + 1].first) ans++;       }       cout << ans;     }     return 0;   }   