Language: C++

/*#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include<bits/stdc++.h>
#define ll long long
#define inf 1000000005
#define put putchar('\n')
#define F(i,a,b) for (int i=(a);i<=(b);i++)
#define D(i,a,b) for (int i=(a);i>=(b);i--)
#define go(i,t) for (int i=head[t];i;i=Next[i])
#define sqr(x) ((x)*(x))
#define re register
#define mp make_pair
#define fi first
#define se second
#define pa pair<int,int>
#define pb push_back
#define be begin()
#define en end()
#define ret return puts("-1"),0;
#define mod 1000000007
//#define N 500055
//#define int ll
using namespace std;
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline int read(){char c=getchar();int tot=1;while ((c<'0'|| c>'9')&&c!='-') c=getchar();if (c=='-'){tot=-1;c=getchar();}
int sum=0;while (c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}return sum*tot;}
inline void wr(int x){if (x<0) {putchar('-');wr(-x);return;}if(x>=10)wr(x/10);putchar(x%10+'0');}
inline void wrn(int x){wr(x);put;}inline void wri(int x){wr(x);putchar(' ');}
inline void wrn(int x,int y){wri(x);wrn(y);}inline void wrn(int a,int b,int c){wri(a);wrn(b,c);}
int n,m;
int ksm(ll x,int k){
	int sum=1;
	while (k){
		if (k&1) sum=sum*x%mod;
		x=x*x%mod;k>>=1;
	}
	return sum;
}
int C(int n,int m){return (n<m||m<0)?0:1LL*fac[n]*inv[m]%mod*inv[n-m]%mod;}
void init(int x){
	fac[0]=1;F(i,1,x) fac[i]=1LL*fac[i-1]*i%mod;
	inv[x]=ksm(fac[x],mod-2);F(i,x-1,0) inv[i]=1LL*inv[i+1]*(i+1)%mod;
}
inline add(int &x,int k){x+=k;x-=(x>=mod)?mod;0;x+=(x<0)?mod:0;}
signed main(){	
	init(2000000);
	F(i,1,6) x[i]=read();
	F(i,1,6) y[i]=read();
	F(i,x[3]+1,x[4]){
		x=-gt(i,y[3]-1);
		x=1LL*x*gt2(i,y[3])%mod;
		x=1LL*x*(i+y[3])%mod;
		add(ans,x);
	}
	F(i,y[3]+1,y[4]){
		x=-gt(x[3]+1,i);
		x=1LL*x*gt2(x[3],i)%mod;
		x=1LL*x*(x[3]+i);
		add(ans,x);
	}
	x=-gt(x[3],y[3]);
	x=1LL*x*gt2(x[3],y[3])%mod;
	x=1LL*x*(x[3]+y[3]);
	add(ans,x);
	F(i,x[3],x[4]-1){
		x=gt(i,y[4]);
		x=1LL*x*gt2(i,y[4]+1)%mod;
		x=1LL*x*(i+y[4]+1)%mod;
		add(ans,x);
	}
	F(i,y[3],y[4]-1){
		x=gt(x[4],i);
		x=1LL*x*gt2(x[4]+1,i)%mod;
		x=1LL*x*(x[4]+1+i)%mod;
		add(ans,x);
	}
	x=gt(x[4],y[4]);
	x=1LL*x*gt2(x[4],y[4])%mod;
	x=1LL*x*(x[4]+y[4]+1)%mod;
	add(ans,x);
	return 0;
}

Compiler output:
a.cc: In function 'int C(int, int)':
a.cc:44:44: error: 'fac' was not declared in this scope
   44 | int C(int n,int m){return (n<m||m<0)?0:1LL*fac[n]*inv[m]%mod*inv[n-m]%mod;}
      |                                            ^~~
a.cc:44:51: error: 'inv' was not declared in this scope; did you mean 'int'?
   44 | int C(int n,int m){return (n<m||m<0)?0:1LL*fac[n]*inv[m]%mod*inv[n-m]%mod;}
      |                                                   ^~~
      |                                                   int
a.cc: In function 'void init(int)':
a.cc:46:9: error: 'fac' was not declared in this scope
   46 |         fac[0]=1;F(i,1,x) fac[i]=1LL*fac[i-1]*i%mod;
      |         ^~~
a.cc:47:9: error: 'inv' was not declared in this scope; did you mean 'int'?
   47 |         inv[x]=ksm(fac[x],mod-2);F(i,x-1,0) inv[i]=1LL*inv[i+1]*(i+1)%mod;
      |         ^~~
      |         int
a.cc: At global scope:
a.cc:49:8: error: ISO C++ forbids declaration of 'add' with no type [-fpermissive]
   49 | inline add(int &x,int k){x+=k;x-=(x>=mod)?mod;0;x+=(x<0)?mod:0;}
      |        ^~~
a.cc: In function 'int add(int&, int)':
a.cc:49:46: error: expected ':' before ';' token
   49 | inline add(int &x,int k){x+=k;x-=(x>=mod)?mod;0;x+=(x<0)?mod:0;}
      |                                              ^
a.cc:49:46: error: expected primary-expression before ';' token
a.cc:49:64: warning: no return statement in function returning non-void [-Wreturn-type]
   49 | inline add(int &x,int k){x+=k;x-=(x>=mod)?mod;0;x+=(x<0)?mod:0;}
      |                                                                ^
a.cc: In function 'int main()':
a.cc:52:18: error: 'x' was not declared in this scope
   52 |         F(i,1,6) x[i]=read();
      |                  ^
a.cc:53:18: error: 'y' was not declared in this scope
   53 |         F(i,1,6) y[i]=read();
      |                  ^
a.cc:54:13: error: 'x' was not declared in this scope
   54 |         F(i,x[3]+1,x[4]){
      |             ^
a.cc:8:30: note: in definition of macro 'F'
    8 | #define F(i,a,b) for (int i=(a);i<=(b);i++)
      |                              ^
a.cc:55:25: error: 'y' was not declared in this scope
   55 |                 x=-gt(i,y[3]-1);
      |                         ^
a.cc:55:20: error: 'gt' was not declared in this scope; did you mean 'gc'?
   55 |                 x=-gt(i,y[3]-1);
      |                    ^~
      |                    gc
a.cc:56:25: error: 'gt2' was not declared in this scope
   56 |                 x=1LL*x*gt2(i,y[3])%mod;
      |                         ^~~
a.cc:58:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   58 |                 add(ans,x);
      |                     ^~~
      |                     abs
a.cc:60:13: error: 'y' was not declared in this scope
   60 |         F(i,y[3]+1,y[4]){
      |             ^
a.cc:8:30: note: in definition of macro 'F'
    8 | #define F(i,a,b) for (int i=(a);i<=(b);i++)
      |                              ^
a.cc:61:17: error: 'x' was not declared in this scope
   61 |                 x=-gt(x[3]+1,i);
      |                 ^
a.cc:61:20: error: 'gt' was not declared in this scope; did you mean 'gc'?
   61 |                 x=-gt(x[3]+1,i);
      |                    ^~
      |                    gc
a.cc:62:25: error: 'gt2' was not declared in this scope
   62 |                 x=1LL*x*gt2(x[3],i)%mod;
      |                         ^~~
a.cc:64:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   64 |                 add(ans,x);
      |                     ^~~
      |                     abs
a.cc:66:9: error: 'x' was not declared in this scope
   66 |         x=-gt(x[3],y[3]);
      |         ^
a.cc:66:20: error: 'y' was not declared in this scope; did you mean 'yn'?
   66 |         x=-gt(x[3],y[3]);
      |                    ^
      |                    yn
a.cc:66:12: error: 'gt' was not declared in this scope; did you mean 'gc'?
   66 |         x=-gt(x[3],y[3]);
      |            ^~
      |            gc
a.cc:67:17: error: 'gt2' was not declared in this scope
   67 |         x=1LL*x*gt2(x[3],y[3])%mod;
      |                 ^~~
a.cc:69:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   69 |         add(ans,x);
      |             ^~~
      |             abs