Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long  ll;
const ll MOD = 1000000007;

// a, bの最大公約数と， ax+by=gcd(a, b)となるx,yを求める
//拡張ユークリッドの互除法
ll extgcd(ll a, ll b, ll &x, ll &y) {
    ll g = a;
    if(b != 0) {
        g = Extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }
    else {
        x = 1;
        y = 0;
    }

    return g;
}

// ax = gcd(a, m) (mod m) となるxを求める(逆元)
// a, m が互いに素ならば関数値はmod m でのaの逆数となる
ll mod_inverse(ll a, ll m)
{
    ll x, y;
    Extgcd(a, m, x, y);
    return (x % m + m) % m; //(modをとったときに0にしないためにmを足している)
}

const int MAX_N = 2 * 100010;
vector<ll> fact(MAX_N), rfact(MAX_N);
void Init() {
    fact[0] = rfact[0] = 1;
    for (int i = 1; i < MAX_N; ++i) {
        fact[i] = (fact[i - 1] * i) % MOD;
        rfact[i] = (rfact[i - 1] * mod_inverse(i, MOD)) % MOD;
    }
}

inline ll Combination(ll n, ll k) {
    return ((fact[n] * rfact[n - k]) % MOD) * rfact[k] % MOD;
}

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

    Init();

    ll h, w, a, b;

    cin >> h >> w >> a >> b;
    ll ans = 0;
    for (int i = 1; i <= h - a; ++i) {
        ll l1 = Combination(i + b - 2, min(i - 1, b - 1));
        ll l2 = Combination(h - i + w - b - 1, min(w - b - 1, h - i));
        ans = (ans + (l1 * l2) % MOD) % MOD;
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'll extgcd(ll, ll, ll&, ll&)':
a.cc:13:13: error: 'Extgcd' was not declared in this scope; did you mean 'extgcd'?
   13 |         g = Extgcd(b, a % b, y, x);
      |             ^~~~~~
      |             extgcd
a.cc: In function 'll mod_inverse(ll, ll)':
a.cc:29:5: error: 'Extgcd' was not declared in this scope; did you mean 'extgcd'?
   29 |     Extgcd(a, m, x, y);
      |     ^~~~~~
      |     extgcd
a.cc: In function 'int main()':
a.cc:59:43: error: no matching function for call to 'min(int, ll)'
   59 |         ll l1 = Combination(i + b - 2, min(i - 1, b - 1));
      |                                        ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:59:43: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   59 |         ll l1 = Combination(i + b - 2, min(i - 1, b - 1));
      |                                        ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:59:43: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   59 |         ll l1 = Combination(i + b - 2, min(i - 1, b - 1));
      |                                        ~~~^~~~~~~~~~~~~~