criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <vector>
using namespace std;

int N, M;
vector<int> even;
vector<int> odd;
vector<int> a;
vector<int> b;

int main() {
  cin >> N >> M;
  for (int i = 0; i < M; ++i) {
    int t;
    cin >> t;
    if (t & 1) {
      odd.push_back(t);
    } else {
      even.push_back(t);
    }
  }

  if (odd.size() > 2) {
    cout << "Impossible" << endl;
    return 0;
  }

  if (odd.size() == 0) {
    a.push_back(even[0]);
    b.push_back(even[0] - 1);
  } else {
    a.push_back(odd[0]);
    if (odd[0] != 1) {
      b.push_back(odd[0] - 1);
    }
  }

  for (int i=(odd.empty() ? 1 : 0); i < even.size(); ++i) {
    a.push_back(even[i]);
    b.push_back(even[i]);
  }

  if (odd.size() < 2) {
    b.push_back(1);
  } else {
    a.push_back(odd[1]);
    b.push_back(2);
    if (odd[1] != 1) {
      b.push_back(odd[1] - 1);
    }
  }

  for (int i = 0; i < a.size(); ++i) {
    if (i) cout << " ";
    cout << a[i];
  }
  cout << endl;
  cout << b.size() << endl;
  for (int i = 0; i < b.size(); ++i) {
    if (i) cout << " ";
    cout << b[i];
  }
  cout << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin >> N >> M;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <vector>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout << "Impossible" << endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:29: error: 'endl' was not declared in this scope
   23 |     cout << "Impossible" << endl;
      |                             ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <vector>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:53:12: error: 'cout' was not declared in this scope
   53 |     if (i) cout << " ";
      |            ^~~~
a.cc:53:12: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:54:5: error: 'cout' was not declared in this scope
   54 |     cout << a[i];
      |     ^~~~
a.cc:54:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:56:3: error: 'cout' was not declared in this scope
   56 |   cout << endl;
      |   ^~~~
a.cc:56:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:56:11: error: 'endl' was not declared in this scope
   56 |   cout << endl;
      |           ^~~~
a.cc:56:11: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <queue>
#include "math.h"
#include <complex>
#include <iomanip>
#include <map>
#define ifor(i,a,b) for (int i=(a);i<(b);i++)
#define rfor(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
using namespace std;
typedef long double ld;
typedef long long int  lli;
typedef complex <double> P;
const double eps = 1e-11;
int vex[4]={1,0,-1,0};
int vey[4]={0,1,0,-1};
typedef vector<double> Vec;
typedef vector<int> vec;
typedef vector<Vec> MAT;
typedef vector<vec> mat;
lli MOD=1000000007;
//Ax=bをとくAは正方行列
//rankA<=min(m,n)ならば配列０のvecが帰る
int main(){
  int N,M,A[1004];
  cin >> N >> M;
  int cnt =0;
  vector<int> odd;
  rep(i,M){
    cin >> A[i];
    if(A[i]&1){
      cnt++;
      odd.push_back(i);
    }
  }
  vector<int>a,b;
  if(M==1){
    a.push_back(1);
    a.push_back(A[0]-1);
    b.push_back(A[0]);
  }
  else if(M==2){
    a.push_back(A[0]-1);
    a.push_back(A[1]+1);
    b.push_back(A[0]);
    b.push_back(A[1]);
  }else {
    if(cnt>2){
      cout<<"Impossible"<<endl;
      return 0;
    }
    else {
      if(cnt!=0){
      a.push_back(A[odd[0]]-1);
      b.push_back(A[odd[0]]);
      rep(i,M){
        if(i!=odd[0]&&i!=odd[1]){
          b.push_back(A[i]);
          a.push_back(A[i]);
        }
      }
      a.push_back(A[odd[1]]+1);
       b.push_back(A[odd[1]]);
    }
    }
    else{
      rep(i,M){
        a.push_back(A[i]);
        b.push_back(A[i]);
      }
      a[0]++;
      a[M-1]--;
    }
  }
  vector<int>c;
  rep(i,a.size()){
    if(a[i]!=0)c.push_back(a[i]);
  }
  rep(i,b.size())cout<<b[i]<<' ';
  cout<<endl;
  cout<<c.size()<<endl;
  rep(i,c.size())cout<<c[i]<<' ';
  cout<<endl;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:71:5: error: 'else' without a previous 'if'
   71 |     else{
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <queue>
#include "math.h"
#include <complex>
#include <iomanip>
#include <map>
#define ifor(i,a,b) for (int i=(a);i<(b);i++)
#define rfor(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
using namespace std;
typedef long double ld;
typedef long long int  lli;
typedef complex <double> P;
const double eps = 1e-11;
int vex[4]={1,0,-1,0};
int vey[4]={0,1,0,-1};
typedef vector<double> Vec;
typedef vector<int> vec;
typedef vector<Vec> MAT;
typedef vector<vec> mat;
lli MOD=1000000007;
//Ax=bをとくAは正方行列
//rankA<=min(m,n)ならば配列０のvecが帰る
int main(){
  int N,M,A[1004];
  cin >> N >> M;
  int cnt =0;
  vector<int> odd;
  rep(i,M){
    cin >> A[i];
    if(A[i]&1){
      cnt++;
      odd.push_back(i);
    }
  }
  vector<int>a,b;
  if(M==1){
    a.push_back(1);
    a.push_back(A[0]-1);
    b.push_back(A[0]);
  }
  else if(M==2){
    a.push_back(A[0]-1);
    a.push_back(A[1]+1);
    b.push_back(A[0]);
    b.push_back(A[1]);
  }else {
    if(cnt>2){
      cout<<"Impossible"<<endl;
      return 0;
    }
    else {
      if(cnt==1){
      a.push_back(A[odd[0]]-1);
      b.push_back(A[odd[0]]);
      rep(i,M){
        if(i!=odd[0]&&i!=odd[1]){
          b.push_back(A[i]);
          a.push_back(A[i]);
        }
      }
      a.push_back(A[odd[1]]+1);
       b.push_back(A[odd[1]]);
    }
    }
    else{
      rep(i,M){
        a.push_back(A[i]);
        b.push_back(A[i]);
      }
      a[0]++;
      a[M-1]--;
    }
  }
  vector<int>c;
  rep(i,a.size()){
    if(a[i]!=0)c.push_back(a[i]);
  }
  rep(i,b.size())cout<<b[i]<<' ';
  cout<<endl;
  cout<<c.size()<<endl;
  rep(i,c.size())cout<<c[i]<<' ';
  cout<<endl;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:71:5: error: 'else' without a previous 'if'
   71 |     else{
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

int N, M, L, sum;
int A[210];
int B[210];


int main() {
    while (cin >> N >> M) {
        sum = 0;
        int odd = 0;
        for (int i = 0; i < M; ++i) {
            cin >> A[i];
            if (A[i] & 1) {
                swap(A[odd++], A[i]);
            }
        }
        if (odd == 2) swap(A[1], A[M-1]);
        if (odd > 2) puts("Impossible");
        else {
            for (int i = 0; i < M; ++i) cout << A[i] << " ";
            cout << endl;
            vector<int> B;
            if (odd == 0 || M == 1) {
                B.push_back(1);
                for (int i = 0; i < M; ++i) B.push_back(A[i]);
                B.back()--;
            else {
                for (int i = 0; i < M; ++i) B.push_back(A[i]);
                B[0]--; B.back()++;
            }
            for (int i = 0; i < B.size(); ++i) if (B[i] <= 0) B.erase(B.begin() + i--);
            cout << B.size() << endl;
            for (int i = 0; i < B.size(); ++i) cout << B[i] << " ";
            cout << endl;
        }
    }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: error: expected '}' before 'else'
   39 |             else {
      |             ^~~~
a.cc:35:37: note: to match this '{'
   35 |             if (odd == 0 || M == 1) {
      |                                     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define M 4005
#define delta 2001
#define MOD 1000000007
#define ll long long
#define int long long

int n;
int a[M], b[M];
ll ans;
ll f[M][M], mns[M][M];

inline ll quick_pow(ll x, ll k)
{
	ll res = 1;
	while (k)
	{
		if (k & 1) (res *= x) %= MOD;
		(x *= x) %= MOD; k >>= 1;
	}
	return res;
}

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }
	while (isdigit(ch)) { (x *= 10) += ch - '0'; ch = getchar(); }
	return x * f;
}

int main()
{
	n = read();
	for (int i = 1; i <= n; i++)
	{
		a[i] = read(), b[i] = read();
		f[-a[i] + delta][-b[i] + delta]++;
	}

	for (int i = 1; i <= 4004; i++)
		for (int j= 1; j <= 4004; j++)
			(f[i][j] += (f[i-1][j] + f[i][j-1]) % MOD) %= MOD;
	mns[1][1] = 1;
	for (int i = 1; i <= 4004; i++)
		for (int j = 1; j <= 4004; j++)
			(mns[i][j] += (mns[i-1][j] + mns[i][j-1]) % MOD) %= MOD;

	for (int i = 1; i <= n; i++)
	{
		(ans += f[a[i]+delta][b[i]+delta]) %= MOD;
//		cout << a[i] * 2 << ", " << b[i] * 2 << " " << mns[a[i]*2][b[i]*2] << endl;
		((ans -= mns[a[i]*2+1][b[i]*2+1]) += MOD) %= MOD;
	}

	cout << ans * quick_pow(2, MOD-2) % MOD;

	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=5e3;
const int M=2e3+88;
const int mod=1e9+7;
int n,a[M*100],b[M*100],f[N+99][N+99],fac[M*10+99],da;
int ksm(int x,int y){
	int base=1;
	while(y){
		if(y&1)base=(1ll*base*x)%mod;
		x=(1ll*x*x)%mod;
		y>>=1;
	}return base;
}
int C(int n,int m){
	return (1ll*fac[n]*ksm((1ll*fac[m]*fac[n-m]%mod),mod-2))%mod;
}
signed main(){
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i]>>b[i];
	}fac[0]=1;
	for(int i=1;i<=N;i++){
		fac[i]=1ll*fac[i-1]*i%mod;
	}
	for(int i=1;i<=n;i++){
		f[M-a[i]][M-b[i]]++;
	}
	for(int i=1;i<=N;i++){
		for(int k=1;k<=N;k++){
			f[i][k]=(f[i][k]+f[i-1][k]+f[i][k-1])%mod;
		}
	}
	for(int i=1;i<=n;i++){
		da=(da+f[a[i]+M][b[i]+M])%mod;
		da=((da-C(2*(a[i]+b[i]),a[i]*2)mod)%mod+mod)%mod;
	}
	da=(1ll*da*ksm(2,mod-2))%mod;
	cout<<da;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:48: error: expected ')' before 'mod'
   38 |                 da=((da-C(2*(a[i]+b[i]),a[i]*2)mod)%mod+mod)%mod;
      |                     ~                          ^~~
      |                                                )
a.cc:38:65: error: expected ')' before ';' token
   38 |                 da=((da-C(2*(a[i]+b[i]),a[i]*2)mod)%mod+mod)%mod;
      |                    ~                                            ^
      |                                                                 )
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){
      |                 ^
Language: C++

//G
#include<bits/stdc++.h>
using namespace std;
#define as 1000000007
long long n;
struct 
{
	long long a,b;
}cas[200000];
long long op(int n)
{
	long long QWQ=1;
	for(int i=1;i<=n;i++) QWQ*=i;
	return QWQ%as;
}
long long  Con(long long a,long long b)
{
	return op(a+b)/op(a)/op(b)%as;
}
int main()
{
	long  long ans=0;
	cin>>n;
	for(long long i=0;i<n;i++)
	{
		cin>>a[i]>>b[i];
	}
	for(long long i=0;i<n;i++)
	{
		for(long long j=0;j<i;j++)
		{
			long long A=a[i]+a[j],B=b[i]+b[j];
			ans+=Con(A,B)%as;
		}
	}
	cout<<ans%as;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: 'a' was not declared in this scope
   26 |                 cin>>a[i]>>b[i];
      |                      ^
a.cc:26:28: error: 'b' was not declared in this scope
   26 |                 cin>>a[i]>>b[i];
      |                            ^
a.cc:32:37: error: 'a' was not declared in this scope
   32 |                         long long A=a[i]+a[j],B=b[i]+b[j];
      |                                     ^
a.cc:33:36: error: 'B' was not declared in this scope
   33 |                         ans+=Con(A,B)%as;
      |                                    ^
Language: C++

//G
#include<bits/stdc++.h>
using namespacde std;
#define as 1000000007
long long n;
struct 
{
	long long a,b;
}cas[200000];
long long op(int n)
{
	long long QWQ=1;
	for(int i=1;i<=n;i++) QWQ*=i;
	return QWQ%as;
}
long long  Con(long long a,long long b)
{
	return op(a+b)/op(a)/op(b)%as;
}
int main()
{
	long  long ans=0;
	cin>>n;
	for(long long i=0;i<n;i++)
	{
		cin>>a[i]>>b[i];
	}
	for(long long i=0;i<n;i++)
	{
		for(long long j=0;j<i;j++)
		{
			long long A=a[i]+a[j],B=b[i]+b[j];
			ans+=Con(A,B)%as;
		}
	}
	cout<<ans%as;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namespacde'
    3 | using namespacde std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:23:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   23 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:26:22: error: 'a' was not declared in this scope
   26 |                 cin>>a[i]>>b[i];
      |                      ^
a.cc:26:28: error: 'b' was not declared in this scope
   26 |                 cin>>a[i]>>b[i];
      |                            ^
a.cc:32:37: error: 'a' was not declared in this scope
   32 |                         long long A=a[i]+a[j],B=b[i]+b[j];
      |                                     ^
a.cc:33:36: error: 'B' was not declared in this scope
   33 |                         ans+=Con(A,B)%as;
      |                                    ^
a.cc:36:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   36 |         cout<<ans%as;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
const int maxn = int(4e4) + 7, mod = int(1e9) + 7;
typedef long long ll;
ll fac[maxn], inv[maxn];
ll pow(ll x,ll y){
    x%=P;
    ll ans=1;
    while(y){
        if (y&1) ans=ans*x%P;
        x=x*x%P;
        y>>=1;
    }
    return ans%P;
}
void init() {
    fac[0] = 1;
    for (int i = 1; i <= maxn - 10; ++i) fac[i] = fac[i - 1] * i % mod;
    inv[maxn - 10] = pow(fac[maxn - 10], mod - 2);
    for (int i = maxn - 11; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
}

ll C(int x, int y) {
    return fac[x] * inv[y] % mod * inv[x - y] % mod;
}

int n, a[2000007], b[2000007], dp[4007][4007];

int main() {
//    freopen("in.txt", "r", stdin);
    init();
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%d%d", a + i, b + i);
        dp[2001 - a[i]][2001 - b[i]]++;
    }
    for (int i = 1; i <= 4001; i++)
        for (int j = 1; j <= 4001; j++) {
            dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
            dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
        }
    ll ans = 0;
    for (int i = 1; i <= n; i++) ans = (ans + dp[2001 + a[i]][2001 + b[i]]) % mod;
    for (int i = 1; i <= n; i++) ans = (ans - C(a[i] + a[i] + b[i] + b[i], a[i] + a[i]) + mod) % mod;
    printf("%lld\n", ans * pow(2, mod - 2) % mod);
    return 0;
}

Compiler output:
a.cc: In function 'll pow(ll, ll)':
a.cc:10:8: error: 'P' was not declared in this scope
   10 |     x%=P;
      |        ^
a.cc: In function 'int main()':
a.cc:48:31: error: call of overloaded 'pow(int, int)' is ambiguous
   48 |     printf("%lld\n", ans * pow(2, mod - 2) % mod);
      |                            ~~~^~~~~~~~~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
a.cc:9:4: note: candidate: 'll pow(ll, ll)'
    9 | ll pow(ll x,ll y){
      |    ^~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
namespace io
{
#define SIZ (1 << 21 | 1)
#define gc() (io::iS == io::iT ? (io::iT= (io::iS= io::ibuff) + fread(io::ibuff, 1, SIZ, stdin), (io::iS == io::iT ? EOF : *io::iS++)) : *io::iS++)
#define putc(x) (io::oS == io::oT ? (fwrite(io::obuff, 1, io::oS - io::obuff, stdout), io::oS= io::obuff, (*io::oS++= x)) : *io::oS++= x)
#define exit                                          \
	fwrite(io::obuff, 1, io::oS - io::obuff, stdout); \
	return 0;
	char *iS, *iT, ibuff[SIZ], obuff[SIZ], *oS= obuff, *oT= oS + SIZ - 1, fu[110], c;
	int fr;
	template <class Type>
	inline void read(Type &x)
	{
		x= 0;
		Type y= 1;
		for(c= gc(); (c > '9' || c < '0') && c != '-'; c= gc())
			;
		c == '-' ? y= -1 : x= (c & 15);
		for(c= gc(); c >= '0' && c <= '9'; c= gc()) x= x * 10 + (c & 15);
		x*= y;
	}
	inline void reads(char *x)
	{
		for(c= gc(); c == ' ' || c == '\n'; c= gc())
			;
		for(; c != ' ' && c != '\n' && c != EOF; *x= c, c= gc(), ++x)
			;
	}
	template <class Type>
	inline void print(Type x, char text= '\n')
	{
		if(x < 0) putc('-'), x*= -1;
		if(x == 0) putc('0');
		while(x) fu[++fr]= x % 10 + '0', x/= 10;
		while(fr) putc(fu[fr--]);
		putc(text);
	}
	inline void prints(char *x, char *y= NULL, char text= '\n')
	{
		for(; *x && x != y; ++x) putc(*x);
		putc(text);
	}
}  // namespace io
using io::print;
using io::prints;
using io::read;
using io::reads;
#define N 200001
#define M 4005
#define P 1000000007
int n, a[N], b[N], f[M][M], ans, jc[M], invjc[M];
inline int ksm(int a, int b)
{
	int s= 1;
	for(; b; b>>= 1, a= (long long)a * a % P)
		if(b & 1) s= (long long)s * a % P;
	return s;
}
inline int C(int n, int m) { return (long long)jc[n] * invjc[m] % P * invjc[n - m] % P; }
signed main()
{
	read(n);
	for(int i= 1; i <= n; i++) read(a[i]), read(b[i]);
	for(int i= 1; i <= n; i++) f[2000 - a[i]][2000 - b[i]]++;
	for(int i= 0; i <= 4000; i++)
	{
		for(int j= 0; j <= 4000; j++)
		{
			f[i + 1][j]= ((long long)f[i + 1][j] + f[i][j]) % P;
			f[i][j + 1]= ((long long)f[i][j + 1] + f[i][j]) % P;
		}
	}
	for(int i= 1; i <= n; i++) ans= ((long long)ans + f[2000 + a[i]][2000 + b[i]]) % P;
	jc[0]= invjc[0]= 1;
	for(int i= 1; i <= 4000; i++) jc[i]= (long long)jc[i - 1] * i % P, invjc[i]= ksm(jc[i], P - 2);
	for(int i= 1; i <= n; i++) ans= ((long long)ans - C(2 * (a[i] + b[i]), 2 * b[i])) % P, if(ans < 0) ans+= P;
	ans= (long long)ans * ksm(2, P - 2) % P;
	print(ans);
	exit;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:96: error: expected primary-expression before 'if'
   90 |         for(int i= 1; i <= n; i++) ans= ((long long)ans - C(2 * (a[i] + b[i]), 2 * b[i])) % P, if(ans < 0) ans+= P;
      |                                                                                                ^~
Language: C++

/*  بسم الله الرحمن الرحیم  */

/*  شهید حاج قاسم سلیمانی
    انتقام سخت نزدیک است
*/

#include <bits/stdc++.h>
using namespace std ;

#define int ll

#define all(x) x.begin() , x.end()

#define PB push_back
#define F first
#define S second
#define _sz(x) (int)x.size()

#define debug(x) cerr << #x << " = " << x << endl

typedef long long ll ;
typedef pair<int , int> pii ;

const int MAX_N = 2010 , MAX_X = 2010 * 2 , MAX_Y = 2010 * 4 , MAX_M = 200 * 1000 + 19 ;
const int inf = 2e9 + 19 ;
const int MOD = 1e9 + 7 ;

ll a[MAX_M] , b[MAX_M] , n ;
int dp[MAX_X][MAX_X] , C[MAX_Y][MAX_X] ;
ll ans = 0 ;

int mul(ll x , ll y) {
        return 1LL * x * y % MOD ;
}

int sum(ll x , ll y) {
        x += y;
        if (x < 0)
                x += MOD;
        else if (x >= MOD)
                x -= MOD;
        return x;
}

int main() {
        ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) ;
        cin >> n ;
        for (int i = 1 ; i <= n ; i ++) {
                cin >> a[i] >> b[i] ;
                dp[MAX_N - a[i]][MAX_N - b[i]] ++ ;
        }
        for (int i = 1 ; i < MAX_X ; i ++)
                for (int j = 1 ; j < MAX_X ; j ++)
                        dp[i][j] = sum(sum(dp[i][j] , dp[i - 1][j]) , dp[i][j - 1]) ;
        for (int i = 0 ; i < MAX_Y ; i ++) {
		C[i][0] = C[i][i] = 1 ;
		for (int j = 1 ; j < min(i , MAX_X) ; j ++) {
                        C[i][j] = sum(C[i - 1][j] , C[i - 1][j - 1]) ;
                        //if (i == 8038)
                        //        debug(j) ;
                }
	}
        for (int i = 1 ; i <= n ; i ++)
                ans = sum(ans , dp[MAX_N + a[i]][MAX_N + b[i]]) ,  ans = sum(ans, -C[a[i] * 2 + b[i] * 2][a[i] * 2]);
        ans = (mul(ans , (MOD + 1)) / 2) % MOD ;
        if (ans < 0)
                ans += MOD ;
        cout << ans ;
        return (0) ;
}


Compiler output:
a.cc:10:13: error: '::main' must return 'int'
   10 | #define int ll
      |             ^~
a.cc:45:1: note: in expansion of macro 'int'
   45 | int main() {
      | ^~~
Language: C++

/*  بسم الله الرحمن الرحیم  */

/*  شهید حاج قاسم سلیمانی
    انتقام سخت نزدیک است
*/

#include <bits/stdc++.h>
using namespace std ;

#define all(x) x.begin() , x.end()

#define PB push_back
#define F first
#define S second
#define _sz(x) (int)x.size()

#define debug(x) cerr << #x << " = " << x << endl

typedef long long ll ;
typedef pair<int , int> pii ;

const int MAX_N = 2019 , MAX_X = 4019 , MAX_Y = 8019 ;
const int inf = 2e9 + 19 ;
const int MOD = 1e9 + 7 ;

int Fact[MAX_Y] , FactRev[MAX_Y] , a[MAX_N * 100] , b[MAX_N * 100] , dp[MAX_X][MAX_X] , n , C[MAX_Y][MAX_X] ;
ll ans = 0 ;

int mul(int x , int y) {
        return 1LL * x * y % MOD ;
}

int sum(int x , int y) {
        x += y;
        if (x < 0)
                x += MOD;
        else if (x >= MOD)
                x -= MOD;
        return x;
}

int main() {
        ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) ;
        cin >> n ;
        for (int i = 1 ; i <= n ; i ++) {
                cin >> a[i] >> b[i] ;
                dp[MAX_N - a[i]][MAX_N - b[i]] ++ ;
        }
        for (int i = 1 ; i < MAX_X ; i ++)
                for (int j = 1 ; j < MAX_X ; j ++)
                        dp[i][j] = sum(sum(dp[i][j] , dp[i - 1][j]) , dp[i][j - 1]) ;
        for (int i = 0 ; i<MAX_Y ; i ++){
		C[i][0] = C[i][i] = 1 ;
		for (int j = 1 ; j < min(i , MAX_X) ; j ++) C[i][j] = sum(C[i - 1][j] , C[i - 1][j - 1]) % MOD ;
	}
        for (int i = 1 ; i <= n ; i ++)
                ans = sum(ans , dp[MAX_N + a[i]][MAX_N + b[i]]) ,  ans = sum(ans, -C[a[i] * 2 + b[i] * 2][a[i] * 2]);
        ans = mul(ans, pw(2, MOD - 2)) ;
        cout << ans ;
        return (0) ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:24: error: 'pw' was not declared in this scope; did you mean 'pow'?
   58 |         ans = mul(ans, pw(2, MOD - 2)) ;
      |                        ^~
      |                        pow
Language: C++

/*  بسم الله الرحمن الرحیم  */

/*  شهید حاج قاسم سلیمانی
    انتقام سخت نزدیک است
*/

#include <bits/stdc++.h>
using namespace std ;

#define all(x) x.begin() , x.end()

#define PB push_back
#define F first
#define S second
#define _sz(x) (int)x.size()

#define debug(x) cerr << #x << " = " << x << endl

typedef long long ll ;
typedef pair<int , int> pii ;

const int MAX_N = 2019 , MAX_X = 4019 , MAX_Y = 8019 ;
const int inf = 2e9 + 19 ;
const int MOD = 1e9 + 7 ;

int Fact[MAX_Y] , FactRev[MAX_Y] , a[MAX_N * 100] , b[MAX_N * 100] , dp[MAX_X][MAX_X] , n , C[MAX_Y][MAX_X] ;
ll ans = 0 ;

int mul(int x , int y) {
        return 1LL * x * y % MOD ;
}

int sum(int x , int y) {
        x += y;
        if (x < 0)
                x += MOD;
        else if (x >= MOD)
                x -= MOD;
        return x;
}

int pw(ll x , ll y) {
        ll res = 1 ;
        while (y) {
                if (y & 1) res = mul(res, x);
                x = mul(x, x);
                y >>= 1 ;
        }
        return res;
}

int main() {
        ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) ;
        prep() ;
        cin >> n ;
        for (int i = 1 ; i <= n ; i ++) {
                cin >> a[i] >> b[i] ;
                dp[MAX_N - a[i]][MAX_N - b[i]] ++ ;
        }
        for (int i = 1 ; i < MAX_X ; i ++)
                for (int j = 1 ; j < MAX_X ; j ++)
                        dp[i][j] = sum(sum(dp[i][j] , dp[i - 1][j]) , dp[i][j - 1]) ;
        for (int i = 0 ; i<MAX_Y ; i ++){
		C[i][0] = C[i][i] = 1 ;
		for (int j = 1 ; j < min(i , MAX_X) ; j ++) C[i][j] = sum(C[i - 1][j] , C[i - 1][j - 1]) % MOD ;
	}
        for (int i = 1 ; i <= n ; i ++)
                ans = sum(ans , dp[MAX_N + a[i]][MAX_N + b[i]]) ,  ans = sum(ans, -C[a[i] * 2 + b[i] * 2][a[i] * 2]);
        ans = mul(ans, pw(2, MOD - 2)) ;
        cout << ans ;
        return (0) ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:9: error: 'prep' was not declared in this scope
   54 |         prep() ;
      |         ^~~~
Language: C++

v#include<bits/stdc++.h>
using namespace std;

const int N = 200 * 1000 + 20, mod = 1e9 + 7, X = 4000 + 20;
int x[N], y[N], dp[X][X], c[X][X], n, ans;

int sum(int a, int b) {
    return ((1LL * a + b) % mod + mod) % mod;
}

int mul(int a, int b) {
    return ((1LL * a * b) % mod + mod) % mod;
}

int pw(int a, int b) {
    int res = 1, tmp = a;
    while (b) {
        if (b & 1)
            res = mul(res, tmp);
        tmp = mul(tmp, tmp);
        b >>= 1;
    }
    return res;
}

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> x[i] >> y[i];
    for (int i = 0; i <= 4000; i++) {
        c[i][0] = 1;
        for (int j = 1; j <= i; j++)
            c[i][j] = sum(c[i - 1][j], c[i - 1][j - 1]);
    }
    for (int i = 0; i < n; i++)
        dp[2000 - x[i]][2000 - y[i]]++;
    for (int i = 0; i <= 4000; i++)
        for (int j = 0; j <= 4000; j++) {
            if (i)
                dp[i][j] = sum(dp[i][j], dp[i - 1][j]);
            if (j)
                dp[i][j] = sum(dp[i][j], dp[i][j - 1]);
        }
    for (int i = 0; i < n; i++)
        ans = sum(ans, dp[x[i] + 2000][y[i] + 2000]);
    for (int i = 0; i < n; i++)
        ans = sum(ans, -c[x[i] + x[i] + y[i] + y[i]][x[i] + x[i]]);
    ans = mul(ans, pw(2, mod - 2));
    return cout << ans << "\n", 0;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:27:5: error: 'ios_base' has not been declared
   27 |     ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
      |     ^~~~~~~~
a.cc:27:39: error: 'cin' was not declared in this scope
   27 |     ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
      |                                       ^~~
a.cc:27:51: error: 'cout' was not declared in this scope
   27 |     ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
      |                                                   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define ff first
#define ss second
#define pb push_back

const int MAXN = 2e5 + 100, maxval = 2010, mod = 1e9 + 7;

int n;
int a[MAXN], b[MAXN];
int dp[maxval << 1][maxval << 1];
long long fact[MAXN], invfact[MAXN];
long long ans;

long long pw(long long a, long long b) {
    if (!b)
        return 1LL;
    long long tmp = pw(a, b / 2);

    tmp = tmp * tmp % mod;

    if (b & 1)
        tmp = tmp * a % mod;
    return tmp;
}

inline void sum(int &a, int b) {
    a += b;
    if (a >= mod)
        a -= mod;
    else if (a < 0)
        a += mod;
}

long long comb(int n, int r) {
    return fact[n] * (invfact[r] * invfact[n - r] % mod) % mod;
}

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    fact[0] = 1;
    invfact[0] = pw(fact[0], mod - 2);

    for (int i = 1; i < MAXN; i++) {
        fact[i] = fact[i - 1] * i % mod;
        invfact[i] = pw(fact[i], mod - 2);
    }

    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
        dp[maxval - a[i]][maxval - b[i]]++;
    }

    for (int i = 0; i < maxval * 2 - 2; i++)
        for (int j = 0; j < maxval * 2 - 2; j++) {
            sum(dp[i + 1][j], dp[i][j]);
            sum(dp[i][j + 1], dp[i][j]);
        }

    for (int i = 0; i < n; i++)
        ans = (ans + dp[maxval + a[i]][maxval + b[i]]) % mod;

    for (int i = 0; i < n; i++)
        ans = (ans - comb(2 * a[i] + 2 * b[i], 2 * a[i]) + mod) % mod;

    cout << ans * invfact(2) % mod << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:26: error: 'invfact' cannot be used as a function
   68 |     cout << ans * invfact(2) % mod << '\n';
      |                   ~~~~~~~^~~
Language: C++

#include<iostream>
#define mod 1000000007
using namespace std;
long long dp[８001][8001],a[8001],b[8001],ans,jc[8001],invjc[8001];
long long C(int a,int b)
{
  return jc[b]*invjc[a]%mod*invjc[b-a]%mod;
}
long long fast_pow(long long a,int b)
{
  if (b==0)
    return 1;
  if (b&1)
    return fast_pow(a*a%mod,b/2)*a%mod;
  else
    return fast_pow(a*a%mod,b/2);
}
int main()
{
  int n;
  cin>>n;
  for (int i=1;i<=n;++i)
    cin>>a[i]>>b[i];
  for (int i=1;i<=n;++i)
    dp[2000-a[i]][2000-b[i]]++;
  for (int i=1;i<=4000;++i)
    for (int j=1;j<=4000;++j)
      dp[i][j]=(dp[i][j]+dp[i-1][j]+dp[i][j-1])%mod;
  for (int i=1;i<=n;++i)
    ans=(ans+dp[a[i]+2000][b[i]+2000])%mod;
  jc[0]=1;
  for (int i=1;i<=8000;++i)
    jc[i]=jc[i-1]*i%mod;
  invjc[8000]=fast_pow(jc[8000],mod-2);
  for (int i=7999;i>=0;--i)
    invjc[i]=invjc[i+1]*(i+1)%mod;
  for (int i=1;i<=n;++i)
    ans=(ans-C(2*a[i],2*a[i]+2*b[i])+mod)%mod;
  cout<<ans*fast_pow(2,mod-2)%mod<<endl;
  return 0;
}

Compiler output:
a.cc:4:14: error: '\U0000ff18001' was not declared in this scope
    4 | long long dp[８001][8001],a[8001],b[8001],ans,jc[8001],invjc[8001];
      |              ^~~~~
a.cc: In function 'int main()':
a.cc:25:5: error: 'dp' was not declared in this scope
   25 |     dp[2000-a[i]][2000-b[i]]++;
      |     ^~
a.cc:28:7: error: 'dp' was not declared in this scope
   28 |       dp[i][j]=(dp[i][j]+dp[i-1][j]+dp[i][j-1])%mod;
      |       ^~
a.cc:30:14: error: 'dp' was not declared in this scope
   30 |     ans=(ans+dp[a[i]+2000][b[i]+2000])%mod;
      |              ^~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef long long LL;

const int N=200000 + 10;
const LL MOD = 1000000007;
int n,a[N],b[N];
LL fac[N],inv[N];
LL mpow(LL a, LL x){
    if(x==0)return 1;
    LL t=mpow(a,x>>1);
    if(x%2==0)return t*t%MOD;
    return t*t%MOD*a%MOD; 
}
int getId(int x,int y) {
    return (x+2000)*4000+(y+2000);
}
int dx[2]={1,0};
int dy[2]={0,1};
bool inside(int x,int y){
    return x>=-2000 && x<=2000 && y>=-2000 && y<=2000;
}
const int V=17000000+2;
int S=V-2,T=V-1;
struct Edge {
    int v,nex;
} edge[V<<1];
int head[V],tot;
int dis[V],in[V]; bool vis[V],canreach[V];
void link(int u,int v){
    edge[tot].v=v; edge[tot].nex=head[u]; head[u]=tot++;
}
void init(){
    queue<int> q; q.push(S); canreach[S]=1;
    while(q.size()){
        int u=q.front(); q.pop(); 
        for(int i=head[u];i!=-1;i=edge[i].nex) {
            int v=edge[i].v; 
            if(!canreach[v]) {
                q.push(v); canreach[v]=1;
            }
        }
    }
    for(int i=1;i<V;i++){
        if(!canreach[i]) continue;
        for(int e=head[i];e!=-1;e=edge[e].nex) {
            in[edge[e].v]++;
        }
    }
}
void BFS(){
    queue<int> q;
    q.push(S); vis[S]=1; dis[S]=1;
    while(q.size()){
        int u=q.front(); q.pop();
        //printf("u=%d, %d\n",u,dis[u]);
        for(int i=head[u];i!=-1;i=edge[i].nex){
            //printf("v=%d, %d\n", v, in[v]);
            int v=edge[i].v;
            if(in[v]){
                --in[v]; 
                (dis[v]+=dis[u])%=MOD;
                if(in[v]==0) q.push(v);
            }
        } 
    }
}
int main() {
    memset(head,-1,sizeof(head));
    fac[0]=1; inv[0]=1;
    for(int i=1;i<N;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=mpow(fac[i],MOD-2);
    }
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d%d",&a[i],&b[i]);
    }
    int L=1999;
    for(int i=-L;i<=L;i++){
        for(int j=-L;j<=L;j++){
            for(int dir=0;dir<2;dir++){
                int nx=i+dx[dir], ny=j+dy[dir];
                if(inside(nx,ny)) {
                    link(getId(i,j), getId(nx,ny));
                }
            }
        }
    }   
    for(int i=1;i<=n;i++){
        link(S,getId(-a[i],-b[i]));
    }
    for(int i=1;i<=n;i++){
        link(getId(a[i],b[i]),T);
    }
    init();
    BFS();
    LL ans=dis[T];
    for(int i=1;i<=n;i++) {
        ans=ans-(fac[2*a[i]+2*b[i]] * inv[2*a[i]] % MOD * inv[2*b[i]] % MOD);
        ans=(ans%MOD+MOD)%MOD;
    }
    printf("%d\n", ans * (MOD+1)/2 % MOD);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:5: error: 'memset' was not declared in this scope
   71 |     memset(head,-1,sizeof(head));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <queue>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<set>
#define ll long long
#define mod 1000000007
#define Mod1(x) (x>=mod?x-mod:x)
#define Mod2(x) (x<0?x+mod:x)
#define maxn 200010
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static int buf[20],len; len=0;
	if(x<0)x=-x,putchar('-');
	for(;x;x/=10)buf[len++]=x%10;
	if(!len)putchar('0');
	else while(len)putchar(buf[--len]+'0');
}
inline void writeln(ll x){write(x); putchar('\n');}
inline void writesp(ll x){write(x); putchar(' ');}
const int size=4010,inv2=(mod+1)>>1;
struct edge{
	int to,nxt;
}e[2*size*size+2*maxn];
int fac[2*size],inv[2*size];
int a[maxn],b[maxn];
int fir[size*size],dp[size*size],in[size*size],q[size*size];
int n,tot;
inline void add_edge(int x,int y){++in[y]; e[tot].to=y; e[tot].nxt=fir[x]; fir[x]=tot++;}
inline int getid(int x,int y){return (x+2000)*4001+(y+2000)+1;}
inline  power(ll a,ll b)
{
	ll ans=1;
	for(;b;b>>=1,a=a*a%mod)
		if(b&1)ans=ans*a%mod;
	return ans;
}
inline ll C(ll n,ll m){return (ll)fac[n]*inv[m]%mod*inv[n-m]%mod;}
int main()
{
	n=read();
	for(int i=1;i<=n;i++)
		a[i]=read(),b[i]=read();
	memset(fir,255,sizeof(fir)); tot=0;
	for(int i=-2000;i<=2000;i++)
		for(int j=-2000;j<=2000;j++){
			if(i<2000)add_edge(getid(i,j),getid(i+1,j));
			if(j<2000)add_edge(getid(i,j),getid(i,j+1));
		}
	int S=0,T=4001*4001+1;
	for(int i=1;i<=n;i++){
		add_edge(S,getid(-a[i],-b[i]));
		add_edge(getid(a[i],b[i]),T);
	}
	// writesp(in[S]); writeln(in[T]);
	int h=1,t=0;
	for(int i=0;i<=T;i++)
		if(!in[i])q[++t]=i;
	dp[S]=1;
	while(h<=t){
		int now=q[h++];
		// if(dp[now]>0&&dp[T]==0)printf("%d %d %d %d %d -> %d %d\n",h,t,now,(now-1)/4001-2000,(now-1)%4001-2000,dp[now],dp[T]);
		for(int i=fir[now];~i;i=e[i].nxt){
			// if(e[i].to==T)printf("%d -> %d : %d %d\n",now,T,dp[now],dp[T]);
			dp[e[i].to]=Mod1(dp[e[i].to]+dp[now]);
			--in[e[i].to];
			if(!in[e[i].to])q[++t]=e[i].to;
		}
	}
	// for(int i=-2;i<=2;i++){
	// 	for(int j=-2;j<=2;j++)
	// 		writesp(dp[getid(i,j)]);
	// 	putchar('\n');
	// }
	fac[0]=inv[0]=1;
	for(int i=1;i<=8000;i++)
		fac[i]=(ll)fac[i-1]*i%mod,inv[i]=power(fac[i],mod-2);
	// for(int i=1;i<=10;i++)
	// 	printf("%d %d %d\n",i,fac[i],inv[i]);
	int ans=dp[T];
	// writeln(ans);
	for(int i=1;i<=n;i++)
		ans=Mod2(ans-C(2*a[i]+2*b[i],2*a[i]));
	// writeln(ans);
	writeln((ll)ans*inv2%mod);
	return 0;
}

Compiler output:
a.cc:39:9: error: ISO C++ forbids declaration of 'power' with no type [-fpermissive]
   39 | inline  power(ll a,ll b)
      |         ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<set>
#define ll long long
#define mod 1000000007
#define Mod1(x) (x>=mod?x-mod:x)
#define Mod2(x) (x<0?x+mod:x)
#define maxn 200010
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static int buf[20],len; len=0;
	if(x<0)x=-x,putchar('-');
	for(;x;x/=10)buf[len++]=x%10;
	if(!len)putchar('0');
	else while(len)putchar(buf[--len]+'0');
}
inline void writeln(ll x){write(x); putchar('\n');}
inline void writesp(ll x){write(x); putchar(' ');}
const int size=4010,inv2=(mod+1)>>1;
struct edge{
	int to,nxt;
}e[2*size*size+2*maxn];
int fac[2*size],inv[2*size];
int a[maxn],b[maxn];
int fir[size*size],dp[size*size],in[size*size],q[size*size];
int n,tot;
inline void add_edge(int x,int y){++in[y]; e[tot].to=y; e[tot].nxt=fir[x]; fir[x]=tot++;}
inline getid(int x,int y){return (x+2000)*4001+(y+2000)+1;}
ll power(ll a,ll b)
{
	ll ans=1;
	for(;b;b>>=1,a=a*a%mod)
		if(b&1)ans=ans*a%mod;
	return ans;
}
ll C(ll n,ll m){return (ll)fac[n]*inv[m]%mod*inv[n-m]%mod;}
int main()
{
	n=read();
	for(int i=1;i<=n;i++)
		a[i]=read(),b[i]=read();
	memset(fir,255,sizeof(fir)); tot=0;
	for(int i=-2000;i<=2000;i++)
		for(int j=-2000;j<=2000;j++){
			if(i<2000)add_edge(getid(i,j),getid(i+1,j));
			if(j<2000)add_edge(getid(i,j),getid(i,j+1));
		}
	int S=0,T=4001*4001+1;
	for(int i=1;i<=n;i++){
		add_edge(S,getid(-a[i],-b[i]));
		add_edge(getid(a[i],b[i]),T);
	}
	// writesp(in[S]); writeln(in[T]);
	int h=1,t=0;
	for(int i=0;i<=T;i++)
		if(!in[i])q[++t]=i;
	dp[S]=1;
	while(h<=t){
		int now=q[h++];
		// if(dp[now]>0&&dp[T]==0)printf("%d %d %d %d %d -> %d %d\n",h,t,now,(now-1)/4001-2000,(now-1)%4001-2000,dp[now],dp[T]);
		for(int i=fir[now];~i;i=e[i].nxt){
			// if(e[i].to==T)printf("%d -> %d : %d %d\n",now,T,dp[now],dp[T]);
			dp[e[i].to]=Mod1(dp[e[i].to]+dp[now]);
			--in[e[i].to];
			if(!in[e[i].to])q[++t]=e[i].to;
		}
	}
	// for(int i=-2;i<=2;i++){
	// 	for(int j=-2;j<=2;j++)
	// 		writesp(dp[getid(i,j)]);
	// 	putchar('\n');
	// }
	fac[0]=inv[0]=1;
	for(int i=1;i<=8000;i++)
		fac[i]=(ll)fac[i-1]*i%mod,inv[i]=power(fac[i],mod-2);
	// for(int i=1;i<=10;i++)
	// 	printf("%d %d %d\n",i,fac[i],inv[i]);
	int ans=dp[T];
	// writeln(ans);
	for(int i=1;i<=n;i++)
		ans=Mod2(ans-C(2*a[i]+2*b[i],2*a[i]));
	// writeln(ans);
	writeln((ll)ans*inv2%mod);
	return 0;
}

Compiler output:
a.cc:38:8: error: ISO C++ forbids declaration of 'getid' with no type [-fpermissive]
   38 | inline getid(int x,int y){return (x+2000)*4001+(y+2000)+1;}
      |        ^~~~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <assert.h>
#include <fstream>

using namespace std;

typedef long long ll;

const int MAXN = 4005;
const int MOD = 1000000007;

int n,ans1,ans2;
int f[MAXN << 1][MAXN];
int mrk[MAXN][MAXN];

int power(int a,int b)
{
	int res = 1;
	while (b)
	{
		if (b & 1)
			res = (ll)res * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return res;
}

int main()
{
	ios::sync_with_stdio(false);
	for (int i = 0;i <= 8000;i++)
	{
		f[i][0] = 1;
		for (int j = 1;j <= min(i,4000);j++)
			f[i][j] = (f[i - 1][j] + f[i - 1][j - 1]) % MOD;
	}
	cin >> n;
	for (int a,b,i = 1;i <= n;i++)
	{
		cin >> a >> b;
		(ans2 += f[(a + b) << 1][a << 1]) %= MOD;
		mrk[2000 - a][2000 - b]++;
		mrk[2000 + a][2000 + b]++;
	}
	memset(f,0,sizeof(f));
	for (int i = 0;i <= 4000;i++)
		for (int j = 0;j <= 4000;j++)
		{
			if (i < 2000 && j < 2000)
				f[i][j] = mrk[i][j];
			if (i)
				(f[i][j] += f[i - 1][j]) %= MOD;
			if (j)
				(f[i][j] += f[i][j - 1]) %= MOD;
			if (i > 2000 && j > 2000)
				ans1 = ((ll)mrk[i][j] * f[i][j] + ans) % MOD;
		}
	cout << ((ll)(ans1 - ans2 + MOD) * (MOD + 1) / 2) % MOD << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:67: error: 'ans' was not declared in this scope; did you mean 'ans2'?
   68 |                                 ans1 = ((ll)mrk[i][j] * f[i][j] + ans) % MOD;
      |                                                                   ^~~
      |                                                                   ans2
Language: C

#include<stdio.h>
int fact(int n);
int main()
{
int n,i,j;
scanf("%d",&n);
int a[n],b[n];
for(int i=0;i<n;i++)
{
scanf("%d%d",&a[i],&b[i]);
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
sum+=fact(a[i]+b[i]+a[j]+b[j])/(fact(a[i]+a[j])*fact(b[i]+b[j]));
}
}
printf("%d",sum);
return 0;
}
int fact(int n)
{
int i=n,f=1;
while(i!=0)
{
f=f*i;
i--;
}
return f;
}

Compiler output:
main.c: In function 'main':
main.c:16:1: error: 'sum' undeclared (first use in this function)
   16 | sum+=fact(a[i]+b[i]+a[j]+b[j])/(fact(a[i]+a[j])*fact(b[i]+b[j]));
      | ^~~
main.c:16:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
using namespace std;
#define mod 1000000007
#define N 4050
#define m 2001
#define M 200050
typedef long long ll;
int f[N][N],n;
struct A {
	int x,y;
}a[M];
ll fac[M],inv[M];
const ll inv2=(mod+1)/2;
ll qp(ll x,ll y) {
	ll re=1;
	for(;y;y>>=1,x=x*x%mod) if(y&1) re=re*x%mod; return re;
}
ll C(int x,int y) {
	if(x<y) return 0;
	return fac[x]*inv[y]%mod*inv[x-y]%mod;
}
int main() {
	scanf("%d",&n);
	int i,j;
	for(fac[0]=i=1;i<M;i++) fac[i]=fac[i-1]*i%mod;
	inv[M-1]=qp(fac[M-1],mod-2);
	for(i=M-2;i>=0;i--) inv[i]=inv[i+1]*(i+1)%mod;
	for(i=1;i<=n;i++) {
		scanf("%d%d",&a[i].x,&a[i].y);
		f[m-a[i].x][m-a[i].y]++;
	}
	ll ans=0;
	int lim=m<<1;
	for(i=1;i<=lim;i++) {
		for(j=1;j<=lim;j++) {
			f[i][j]=(ll(f[i][j])+f[i-1][j)+f[i][j-1])%mod;
		}
	}
	for(i=1;i<=n;i++) {
		ans=(ans+f[m+a[i].x][m+a[i].y])%mod;
		ans=(ans-C(a[i].x*2+a[i].y*2,a[i].x*2))%mod;
	}
	ans=ans*inv2%mod;
	printf("%lld\n",(ans%mod+mod)%mod);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:54: error: expected ']' before ')' token
   39 |                         f[i][j]=(ll(f[i][j])+f[i-1][j)+f[i][j-1])%mod;
      |                                                      ^
      |                                                      ]
a.cc:39:65: error: expected ';' before ')' token
   39 |                         f[i][j]=(ll(f[i][j])+f[i-1][j)+f[i][j-1])%mod;
      |                                                                 ^
      |                                                                 ;
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define pb push_back

const int maxn = 2e5 + 20;
const int maxm = 2e3 + 20;
const int mod = 1e9 + 7;

ll dp[2 * maxm][2 * maxm] , a[maxn] , b[maxn] , fac[maxn] , caf[maxn];

void mkay(int &a)
{
	while(a >= mod)
		a -= mod;
}

int bpw(int a , int b)
{
	if(!b)
		return 1;

	int x = bpw(a , b / 2);

	x = 1LL * x * x % mod;
	if(b&1)
		x = 1LL * x * a % mod;

	return x;
}

int c(int s , int r)
{
	if(r < 0 || r > s)
		return 0;

	return 1LL * fac[s] * caf[r] % mod * caf[s - r] % mod;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	fac[0] = 1;
	for(int i = 1; i < maxn; i++)
		fac[i] = 1LL * fac[i - 1] * i % mod;

	caf[maxn - 1] = bpw(fac[maxn - 1] , mod - 2);

	for(int i = maxn - 1; i > 0; i--)
		caf[i - 1] = 1LL * caf[i] * i % mod;

	int n;
	cin >> n;

	for(int i = 0; i < n; i++)
		cin >> a[i] >> b[i] , dp[-a[i] + maxm][-b[i] + maxm]++;

	for(int i = 1; i < 2 * maxm; i++)
		for(int j = 1; j < 2 * maxm; j++)
			mkay(dp[i][j] += dp[i - 1][j] + dp[i][j - 1]);

	int res = 0;
	for(int i = 0; i < n; i++)
	{
		mkay(res += dp[a[i] + maxm][b[i] + maxm]);
		mkay(res -= c((a[i] + b[i]) * 2 , 2 * a[i]));
	}

	cout << 1LL * res * bpw(2 , mod - 2) % mod << endl;
}








Compiler output:
a.cc: In function 'int main()':
a.cc:64:39: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   64 |                         mkay(dp[i][j] += dp[i - 1][j] + dp[i][j - 1]);
      |                              ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:13:16: note:   initializing argument 1 of 'void mkay(int&)'
   13 | void mkay(int &a)
      |           ~~~~~^