Language: C++

#include <iostream>
using namespace std;
#define ll long long;

const int mod = 1e9+7, maxn = 2000010;
int r1, c1, r2, c2;

ll pre[maxn];
ll inv[maxn];
ll prei[maxn];
void build(int n){
    pre[1] = pre[0] = 1, inv[1] = inv[0] = 1, prei[1] = prei[0] = 1;
    for(int i = 2 ; i <= n ; i++){
        pre[i] = pre[i-1] * i % mod;
        inv[i] = (mod - mod / i * inv[mod % i] % mod) % mod;
        prei[i] = prei[i-1] * inv[i] % mod;
    }
}
ll C(int n, int k){
   return pre[n] * prei[k] % mod * prei[n-k] % mod;
}

ll solve(int x, int y){
    for (x == 0 || y == 0) return 0;
    ll ret = 0;
    for (int i = 1; i <= y; i++){
        ret += c(x+i+1, i+1);
    }
    ret -= y;
    return ret % mod;
}

int main(){
    build(2000005);
    cin >> r1 >> c1 >> r2 >> c2;
    cout << (solve(r2, c2)-solve(r1-1, c2)-solve(r2, c1-1)+solve(r1-1, c1-1)+mod*2)%mod << "\n";
}


Compiler output:
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:8:1: note: in expansion of macro 'll'
    8 | ll pre[maxn];
      | ^~
a.cc:8:4: error: 'pre' does not name a type
    8 | ll pre[maxn];
      |    ^~~
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:9:1: note: in expansion of macro 'll'
    9 | ll inv[maxn];
      | ^~
a.cc:9:4: error: 'inv' does not name a type; did you mean 'int'?
    9 | ll inv[maxn];
      |    ^~~
      |    int
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:10:1: note: in expansion of macro 'll'
   10 | ll prei[maxn];
      | ^~
a.cc:10:4: error: 'prei' does not name a type
   10 | ll prei[maxn];
      |    ^~~~
a.cc: In function 'void build(int)':
a.cc:12:5: error: 'pre' was not declared in this scope
   12 |     pre[1] = pre[0] = 1, inv[1] = inv[0] = 1, prei[1] = prei[0] = 1;
      |     ^~~
a.cc:12:26: error: 'inv' was not declared in this scope; did you mean 'int'?
   12 |     pre[1] = pre[0] = 1, inv[1] = inv[0] = 1, prei[1] = prei[0] = 1;
      |                          ^~~
      |                          int
a.cc:12:47: error: 'prei' was not declared in this scope
   12 |     pre[1] = pre[0] = 1, inv[1] = inv[0] = 1, prei[1] = prei[0] = 1;
      |                                               ^~~~
a.cc: At global scope:
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:19:1: note: in expansion of macro 'll'
   19 | ll C(int n, int k){
      | ^~
a.cc:19:4: error: ISO C++ forbids declaration of 'C' with no type [-fpermissive]
   19 | ll C(int n, int k){
      |    ^
a.cc: In function 'int C(int, int)':
a.cc:20:11: error: 'pre' was not declared in this scope
   20 |    return pre[n] * prei[k] % mod * prei[n-k] % mod;
      |           ^~~
a.cc:20:20: error: 'prei' was not declared in this scope
   20 |    return pre[n] * prei[k] % mod * prei[n-k] % mod;
      |                    ^~~~
a.cc: At global scope:
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:23:1: note: in expansion of macro 'll'
   23 | ll solve(int x, int y){
      | ^~
a.cc:23:4: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive]
   23 | ll solve(int x, int y){
      |    ^~~~~
a.cc: In function 'int solve(int, int)':
a.cc:24:26: error: expected ';' before ')' token
   24 |     for (x == 0 || y == 0) return 0;
      |                          ^
      |                          ;
a.cc:3:21: error: expected unqualified-id before ';' token
    3 | #define ll long long;
      |                     ^
a.cc:25:5: note: in expansion of macro 'll'
   25 |     ll ret = 0;
      |     ^~
a.cc:25:8: error: 'ret' was not declared in this scope
   25 |     ll ret = 0;
      |        ^~~
a.cc:25:15: error: expected ')' before ';' token
   25 |     ll ret = 0;
      |               ^
      |               )
a.cc:24:9: note: to match this '('
   24 |     for (x == 0 || y == 0) return 0;
      |         ^
a.cc:27:9: error: 'ret' was not declared in this scope
   27 |         ret += c(x+i+1, i+1);
      |         ^~~
a.cc:27:16: error: 'c' was not declared in this scope
   27 |         ret += c(x+i+1, i+1);
      |                ^
a.cc:29:5: error: 'ret' was not declared in this scope
   29 |     ret -= y;
      |     ^~~