func_code_string: #include <bits/stdc++.h>   using namespace std;   long long N, L, W;   vector<long long> neg, pos;   long long INF32 = 0x7fffffff;   inline long long div_floor(long long a, long long b) {     return (long long)floor(1.0 * a / b);   }   int main() {     cin >> N >> L >> W;     for (int i = 0; i < N; ++i) {       long long x, d;       cin >> x >> d;       (d == 1 ? pos : neg).push_back(d == 1 ? x : x + L);     }     sort(pos.begin(), pos.end());     sort(neg.begin(), neg.end());     long long ans = 0;     for (auto x : pos) {       long long lval = max(-x - 1, x);       if (W == 1) {         if (x < 0) {         } else {           lval = INF32;         }       } else {         lval = max(lval, div_floor(((W + 1) * x), (W - 1)));       }       auto l = upper_bound(neg.begin(), neg.end(), lval);       ans += int(neg.end() - l);       lval = max(x, div_floor((W - 1) * x, (W + 1)));       long long rval = -x;       l = upper_bound(neg.begin(), neg.end(), lval);       auto r = lower_bound(neg.begin(), neg.end(), rval);       ans += max(0, int(r - l));     }     cout << ans << endl;     return 0;   }   