Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;
 
LL md_add(LL x, LL y) {
    return (x%mod) + (y%mod);
}
LL md_sub(LL x, LL y) {
    return ((x%mod) - (y%mod) + mod)%mod;
}
LL md_mul(LL x, LL y) {
    return ((x%mod)*(y%mod))%mod;
}
LL md_pw(LL x, LL y) {
    LL res = 1;
    while(y != 0) {
        if(y%2) {
            res = md_mul(x, res);
            y--;
        }else{
            x = md_mul(x, x);
            y /= 2;
        }
    }
    return res;
}
LL md_div(LL x, LL y) {
    return md_mul(x, md_pw(y, mod - 2));
}
LL md_fact(LL n) {
    LL res = 1;
    FOR(i, 1, n + 1)
        res = md_mul(res, i);
    return res;
}
LL md_combi(LL n, LL r) {
    if(n < r)
        return 0;
    return md_div(md_fact(n), md_mul(md_fact(r), md_fact(n - r)));
}
 
int main() {
    LL H, W, A, B;
    cin >> H >> W >> A >> B;
 
    vector<LL> fact;
    vector<LL> factinv;
    fact.resize(H + W - 1);
    factinv.resize(H + W - 1);
    fact[0] = 1;
    factinv[0] = 1;
    FOR(i, 1, H + W - 1) {
        fact[i] = md_mul(fact[i - 1], i);
        factinv[i] = md_div(1, fact[i]);
    }
 
    LL res = 0;
    for(LL i = 1;i <= H - A;i++) {
        LL d1 = md_div(fact[i + B - 2], md_mul(fact[i - 1], fact[B - 1]));
        LL d2 = md_div(fact[W - B - 1 + H - i], md_mul(fact[H - i], fact[W - B - 1]));
        res = md_add(res, md_mul(d1, d2));
    }
    cout << res << endl;
    return 0;
}
 
#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

LL md_add(LL x, LL y) {
    return (x%mod) + (y%mod);
}
LL md_sub(LL x, LL y) {
    return ((x%mod) - (y%mod) + mod)%mod;
}
LL md_mul(LL x, LL y) {
    return ((x%mod)*(y%mod))%mod;
}
LL md_pw(LL x, LL y) {
    LL res = 1;
    while(y != 0) {
        if(y%2) {
            res = md_mul(x, res);
            y--;
        }else{
            x = md_mul(x, x);
            y /= 2;
        }
    }
    return res;
}
LL md_div(LL x, LL y) {
    return md_mul(x, md_pw(y, mod - 2));
}
LL md_fact(LL n) {
    LL res = 1;
    FOR(i, 1, n + 1)
        res = md_mul(res, i);
    return res;
}
LL md_combi(LL n, LL r) {
    if(n < r)
        return 0;
    return md_div(md_fact(n), md_mul(md_fact(r), md_fact(n - r)));
}

int main() {
    LL H, W, A, B;
    cin >> H >> W >> A >> B;

    vector<LL> fact;
    vector<LL> factinv;
    fact.resize(H + W - 1);
    factinv.resize(H + W - 1);
    fact[0] = 1;
    factinv[0] = 1;
    FOR(i, 1, H + W - 1) {
        fact[i] = md_mul(fact[i - 1], i);
        factinv[i] = md_div(1, fact[i]);
    }

    LL res = 0;
    for(LL i = 1;i <= H - A;i++) {
        LL d1 = md_div(fact[i + B - 2], md_mul(fact[i - 1], fact[B - 1]));
        LL d2 = md_div(fact[W - B - 1 + H - i], md_mul(fact[H - i], fact[W - B - 1]));
        res = md_add(res, md_mul(d1, d2));
    }
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc:81:11: error: redefinition of 'const int IINF'
   81 | const int IINF = 1e9;
      |           ^~~~
a.cc:8:11: note: 'const int IINF' previously defined here
    8 | const int IINF = 1e9;
      |           ^~~~
a.cc:82:10: error: redefinition of 'const long long int LINF'
   82 | const LL LINF = 1e18;
      |          ^~~~
a.cc:9:10: note: 'const long long int LINF' previously defined here
    9 | const LL LINF = 1e18;
      |          ^~~~
a.cc:83:10: error: redefinition of 'const long long int mod'
   83 | const LL mod = 1e9+7;
      |          ^~~
a.cc:10:10: note: 'const long long int mod' previously defined here
   10 | const LL mod = 1e9+7;
      |          ^~~
a.cc:85:4: error: redefinition of 'long long int md_add(long long int, long long int)'
   85 | LL md_add(LL x, LL y) {
      |    ^~~~~~
a.cc:12:4: note: 'long long int md_add(long long int, long long int)' previously defined here
   12 | LL md_add(LL x, LL y) {
      |    ^~~~~~
a.cc:88:4: error: redefinition of 'long long int md_sub(long long int, long long int)'
   88 | LL md_sub(LL x, LL y) {
      |    ^~~~~~
a.cc:15:4: note: 'long long int md_sub(long long int, long long int)' previously defined here
   15 | LL md_sub(LL x, LL y) {
      |    ^~~~~~
a.cc:91:4: error: redefinition of 'long long int md_mul(long long int, long long int)'
   91 | LL md_mul(LL x, LL y) {
      |    ^~~~~~
a.cc:18:4: note: 'long long int md_mul(long long int, long long int)' previously defined here
   18 | LL md_mul(LL x, LL y) {
      |    ^~~~~~
a.cc:94:4: error: redefinition of 'long long int md_pw(long long int, long long int)'
   94 | LL md_pw(LL x, LL y) {
      |    ^~~~~
a.cc:21:4: note: 'long long int md_pw(long long int, long long int)' previously defined here
   21 | LL md_pw(LL x, LL y) {
      |    ^~~~~
a.cc:107:4: error: redefinition of 'long long int md_div(long long int, long long int)'
  107 | LL md_div(LL x, LL y) {
      |    ^~~~~~
a.cc:34:4: note: 'long long int md_div(long long int, long long int)' previously defined here
   34 | LL md_div(LL x, LL y) {
      |    ^~~~~~
a.cc:110:4: error: redefinition of 'long long int md_fact(long long int)'
  110 | LL md_fact(LL n) {
      |    ^~~~~~~
a.cc:37:4: note: 'long long int md_fact(long long int)' previously defined here
   37 | LL md_fact(LL n) {
      |    ^~~~~~~
a.cc:116:4: error: redefinition of 'long long int md_combi(long long int, long long int)'
  116 | LL md_combi(LL n, LL r) {
      |    ^~~~~~~~
a.cc:43:4: note: 'long long int md_combi(long long int, long long int)' previously defined here
   43 | LL md_combi(LL n, LL r) {
      |    ^~~~~~~~
a.cc:122:5: error: redefinition of 'int main()'
  122 | int main() {
      |     ^~~~
a.cc:49:5: note: 'int main()' previously defined here
   49 | int main() {
      |     ^~~~