Language: C++

#include<cstdio>
#include<cctype>
#define rr register
using namespace std;
const int M=4001,N=200011,mod=1000000007;
int dp[M][M],fac[M<<1],inv[M<<1],a[N],b[N],ans;
inline signed iut(){
    rr int ans=0; rr char c=getchar();
    while(!isdigit(c)) c=getchar();
    while(isdigit(c)) ans=ans*10+c-48,c=getchar();
    return ans;
}
inline signed mo(int x,int y){return x+y>=mod?x+y-mod:x+y;}
inline signed c(int n,int m){return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;}
signed main(){
    n=iut(),fac[0]=fac[1]=inv[0]=inv[1]=1;
    rr int t=M>>1,T=t<<2;
    for (rr int i=2;i<=T;++i) inv[i]=1ll*inv[mod%i]*(mod-mod/i)%mod;
    for (rr int i=2;i<=T;++i) fac[i]=1ll*fac[i-1]*i%mod,inv[i]=1ll*inv[i-1]*inv[i]%mod;
    for (rr int i=1;i<=n;++i){
        a[i]=iut(),b[i]=iut();
        ++dp[t-a[i]][t-b[i]];
    }
    for (rr int i=1;i<M;++i)
    for (rr int j=1;j<M;++j){
        rr int w=mo(dp[i-1][j],dp[i][j-1]);
        dp[i][j]=mo(dp[i][j],w);
    }
    for (rr int i=1;i<=n;++i){
        ans=mo(ans,dp[t+a[i]][t+b[i]]);
        ans=mo(ans,mod-c(a[i]*2+b[i]*2,a[i]+b[i]);
    }
    return !printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'int iut()':
a.cc:8:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |     rr int ans=0; rr char c=getchar();
      |            ^~~
a.cc:8:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |     rr int ans=0; rr char c=getchar();
      |                           ^
a.cc: In function 'int main()':
a.cc:16:5: error: 'n' was not declared in this scope
   16 |     n=iut(),fac[0]=fac[1]=inv[0]=inv[1]=1;
      |     ^
a.cc:17:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |     rr int t=M>>1,T=t<<2;
      |            ^
a.cc:17:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |     rr int t=M>>1,T=t<<2;
      |                   ^
a.cc:18:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |     for (rr int i=2;i<=T;++i) inv[i]=1ll*inv[mod%i]*(mod-mod/i)%mod;
      |                 ^
a.cc:19:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   19 |     for (rr int i=2;i<=T;++i) fac[i]=1ll*fac[i-1]*i%mod,inv[i]=1ll*inv[i-1]*inv[i]%mod;
      |                 ^
a.cc:20:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   20 |     for (rr int i=1;i<=n;++i){
      |                 ^
a.cc:24:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   24 |     for (rr int i=1;i<M;++i)
      |                 ^
a.cc:25:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 |     for (rr int j=1;j<M;++j){
      |                 ^
a.cc:26:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   26 |         rr int w=mo(dp[i-1][j],dp[i][j-1]);
      |                ^
a.cc:29:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   29 |     for (rr int i=1;i<=n;++i){
      |                 ^
a.cc:31:50: error: expected ')' before ';' token
   31 |         ans=mo(ans,mod-c(a[i]*2+b[i]*2,a[i]+b[i]);
      |               ~                                  ^
      |                                                  )