Language: C++

#include <cstdio>
#define rint register int
#define N 200005
#define M 2003
using namespace std;
const int Mod = 1e9 + 7;
const int eps = 2001;

int n, a[N], b[N], f[M << 1][M << 1];
int fac[M << 1], inv[M << 1], ifac[M << 1];

inline void prework() {
    fac[0] = inv[1] = ifac[0] = 1;
    for (rint i = 1; i <= eps << 1; ++i)
        fac[i] = 1ll * fac[i - 1] * i % Mod;
    for (rint i = 2; i <= eps << 1; ++i)
        inv[i] = 1ll * inv[Mod % i] * (Mod - Mod / i) % Mod;
    for (rint i = 1; i <= eps << 1; ++i)
        ifac[i] = 1ll * ifac[i - 1] * inv[i] % Mod;
}

inline int C(int x, int y) {
    return 1ll * fac[x + y] * ifac[x] % Mod * ifac[y] % Mod;
}

int main() {
#ifdef whyqx
    freopen("work.in", "r", stdin);
    freopen("work.out", "w", stdout);
#endif
    prework(); cin >> n;
    for (rint i = 1; i <= n; ++i)
        scanf("%d%d", a + i, b + i),
        ++f[eps - a[i]][eps - b[i]];
    for (rint i = 1; i <= eps << 1; ++i)
        for (rint j = 1; j <= eps << 1; ++j)
            (f[i][j] += (f[i - 1][j] + f[i][j - 1]) % Mod) %= Mod;
    long long ans = 0;
    for (rint i = 1; i <= n; ++i)
        (ans += f[eps + a[i]][eps + b[i]]) %= Mod;
    for (rint i = 1; i <= n; ++i)
        (ans -= C(a[i] << 1, b[i] << 1)) %= Mod;
    cout << (ans % Mod + Mod) % Mod * ((Mod + 1) >> 1) % Mod;
    return 0;
}


Compiler output:
a.cc: In function 'void prework()':
a.cc:14:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   14 |     for (rint i = 1; i <= eps << 1; ++i)
      |               ^
a.cc:16:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |     for (rint i = 2; i <= eps << 1; ++i)
      |               ^
a.cc:18:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |     for (rint i = 1; i <= eps << 1; ++i)
      |               ^
a.cc: In function 'int main()':
a.cc:31:16: error: 'cin' was not declared in this scope
   31 |     prework(); cin >> n;
      |                ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdio>
  +++ |+#include <iostream>
    2 | #define rint register int
a.cc:32:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   32 |     for (rint i = 1; i <= n; ++i)
      |               ^
a.cc:35:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   35 |     for (rint i = 1; i <= eps << 1; ++i)
      |               ^
a.cc:36:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   36 |         for (rint j = 1; j <= eps << 1; ++j)
      |                   ^
a.cc:39:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   39 |     for (rint i = 1; i <= n; ++i)
      |               ^
a.cc:41:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   41 |     for (rint i = 1; i <= n; ++i)
      |               ^
a.cc:43:5: error: 'cout' was not declared in this scope
   43 |     cout << (ans % Mod + Mod) % Mod * ((Mod + 1) >> 1) % Mod;
      |     ^~~~
a.cc:43:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'