func_code_string: #include <bits/stdc++.h>   using namespace std;   long long n, len, wmax, ans;   vector<long long> vec[2];   inline void _read(long long &x) {     long long f = 1;     x = 0;     char c = getchar();     while (!isdigit(c)) {       if (c ==  - )         f = -1;       else         f = 1;       c = getchar();     }     while (isdigit(c)) {       x = x * 10 + c -  0 ;       c = getchar();     }     x *= f;     return;   }   inline void _print(long long x) {     if (x < 0) {       putchar( - );       x = -x;     }     if (x >= 10) _print(x / 10);     putchar(x % 10 +  0 );     return;   }   inline long long chk(long long x1, long long x2) {     long long x = x1 + x2, y = x2 - x1;     return y * wmax > x && y * wmax > -x;   }   int main() {     _read(n);     _read(len);     _read(wmax);     long long x, v;     for (long long i = 1; i <= n; i++) {       _read(x);       _read(v);       if (v == -1)         vec[0].push_back(x);       else         vec[1].push_back(x);     }     sort(vec[0].begin(), vec[0].end());     if (!vec[0].size()) {       _print(0);       return 0;     }     long long l, r, mid;     for (long long i = 0; i < vec[1].size(); i++) {       l = 0;       r = vec[0].size();       while (l < r) {         mid = (l + r) >> 1;         if (chk(vec[1][i], vec[0][mid] + len))           r = mid;         else           l = mid + 1;       }       ans += (vec[0].size() - r);     }     _print(ans);     return 0;   }   