Language: C++

#include<iostream>
#include<vector>
#define MOD 1000000007
using namespace std;
int fast_pow(int base, int n, int M){
	if (n == 0) return 0;
	if (n == 1)return base;
	int halfn = fast_pow(base, n / 2, M);
	if (n % 2 == 0)  return (long long(halfn)*halfn) % M;
	else return (((long long(halfn) * halfn) % M)*base) % M;
}
int findMMI(int n, int M){
	return fast_pow(n, M - 2, M);
}
int modDiv(int numerator, int denominator, int M){
	int denMMI = findMMI(denominator, M);
	return (long long(numerator)*denMMI) % M;
}

class PerandCom{
public:
	PerandCom(int lmt, int mod){
		M = mod;
		modFact.push_back(1);
		for (int i = 1; i <= lmt; ++i){
			modFact.push_back(int((long long(modFact.back())*i) % M));
		}
	}
	int nCr(int n, int r){
		return modDiv(modFact[n], (long long(modFact[r]) * modFact[n - r]) % M, M);
	}
	int nPr(int n, int r){
		return modDiv(modFact[n], modFact[n - r], M);
	}
private:
	vector<int>modFact;
	int M;
};
int main()
{
	int h, w, a, b;
	cin >> h >> w >> a >> b;
	PerandCom pAc(h + w, MOD);
	long long ans = 0;
	for (int t = 1; t <= h - a; ++t){
		ans +=((long long)pAc.nCr(b + t - 2, b - 1)*pAc.nCr(w - b + h - t - 1, w - b - 1));
		ans %= MOD;
	}
	cout << ans << endl;
	cin >> a;
	return 0;
}



Compiler output:
a.cc: In function 'int fast_pow(int, int, int)':
a.cc:9:34: error: expected primary-expression before 'long'
    9 |         if (n % 2 == 0)  return (long long(halfn)*halfn) % M;
      |                                  ^~~~
a.cc:9:34: error: expected ')' before 'long'
    9 |         if (n % 2 == 0)  return (long long(halfn)*halfn) % M;
      |                                 ~^~~~
      |                                  )
a.cc:10:24: error: expected primary-expression before 'long'
   10 |         else return (((long long(halfn) * halfn) % M)*base) % M;
      |                        ^~~~
a.cc:10:24: error: expected ')' before 'long'
   10 |         else return (((long long(halfn) * halfn) % M)*base) % M;
      |                       ~^~~~
      |                        )
a.cc:10:64: error: expected ')' before ';' token
   10 |         else return (((long long(halfn) * halfn) % M)*base) % M;
      |                      ~                                         ^
      |                                                                )
a.cc:10:64: error: expected ')' before ';' token
   10 |         else return (((long long(halfn) * halfn) % M)*base) % M;
      |                     ~                                          ^
      |                                                                )
a.cc: In function 'int modDiv(int, int, int)':
a.cc:17:17: error: expected primary-expression before 'long'
   17 |         return (long long(numerator)*denMMI) % M;
      |                 ^~~~
a.cc:17:17: error: expected ')' before 'long'
   17 |         return (long long(numerator)*denMMI) % M;
      |                ~^~~~
      |                 )
a.cc: In constructor 'PerandCom::PerandCom(int, int)':
a.cc:26:43: error: expected primary-expression before 'int'
   26 |                         modFact.push_back(int((long long(modFact.back())*i) % M));
      |                                           ^~~
a.cc: In member function 'int PerandCom::nCr(int, int)':
a.cc:30:44: error: expected primary-expression before 'long'
   30 |                 return modDiv(modFact[n], (long long(modFact[r]) * modFact[n - r]) % M, M);
      |                                            ^~~~
a.cc:30:44: error: expected ')' before 'long'
a.cc:30:43: note: to match this '('
   30 |                 return modDiv(modFact[n], (long long(modFact[r]) * modFact[n - r]) % M, M);
      |                                           ^