Language: C++

#include<bits/stdc++.h> 

using namespace std;
typedef long long ll;

int power(int x, unsigned int y, int p) 
{ 
    int res = 1; // Initialize result 
    x = x % p; // Update x if it is more than or 
    // equal to p 
    while (y > 0) { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res * x) % p; 
  
        // y must be even now 
        y = y >> 1; // y = y/2 
        x = (x * x) % p; 
    } 
    return res; 
} 
  
// Function to find modular inverse of a under modulo p 
// using Fermat's method. Assumption: p is prime 
int modInverse(int a, int p) 
{ 
    return power(a, p - 2, p); 
} 
  
// Returns n! % p using Wilson's Theorem 
int modFact(int n, int p) 
{ 
    // n! % p is 0 if n >= p 
    if (p <= n) 
        return 0; 
  
    // Initialize result as (p-1)! which is -1 or (p-1) 
    int res = (p - 1); 
  
    // Multiply modulo inverse of all numbers from (n+1) 
    // to p 
    for (int i = n + 1; i < p; i++) 
        res = (res * modInverse(i, p)) % p; 
    return res; 
} 

int main(){
	int p = 10e9+7;
	ll x,y; cin>>x>>y;

	if(x%3==0&&y%3==0&&x==y){
		cout<<modfact(x/3,p)/modfact(x/6,p)/modfact(x/6,p);

	}
	else {
		if((x-2)%3==0&&(y-1)%3==0&&x-2==y-1){
			cout<<modfact((x-2)/3+1,p)/modfact((x-2)/6,p)/mdfact((x-2)/6+1,p);
		}
		else if((y-2)%3==0&&(x-1)%3==0&&x-1==y-2){
			cout<<modfact((x-1)/3+1,p)/modfact((x-1)/6,p)/mdfact((x-1)/6+1,p);
		}
		else{
			cout<<0;
		}

	}



	int l ; cin>>l;
	
	
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0000000007e+10' to '2147483647' [-Woverflow]
   48 |         int p = 10e9+7;
      |                 ~~~~^~
a.cc:52:23: error: 'modfact' was not declared in this scope; did you mean 'modFact'?
   52 |                 cout<<modfact(x/3,p)/modfact(x/6,p)/modfact(x/6,p);
      |                       ^~~~~~~
      |                       modFact
a.cc:57:31: error: 'modfact' was not declared in this scope; did you mean 'modFact'?
   57 |                         cout<<modfact((x-2)/3+1,p)/modfact((x-2)/6,p)/mdfact((x-2)/6+1,p);
      |                               ^~~~~~~
      |                               modFact
a.cc:57:71: error: 'mdfact' was not declared in this scope; did you mean 'modFact'?
   57 |                         cout<<modfact((x-2)/3+1,p)/modfact((x-2)/6,p)/mdfact((x-2)/6+1,p);
      |                                                                       ^~~~~~
      |                                                                       modFact
a.cc:60:31: error: 'modfact' was not declared in this scope; did you mean 'modFact'?
   60 |                         cout<<modfact((x-1)/3+1,p)/modfact((x-1)/6,p)/mdfact((x-1)/6+1,p);
      |                               ^~~~~~~
      |                               modFact
a.cc:60:71: error: 'mdfact' was not declared in this scope; did you mean 'modFact'?
   60 |                         cout<<modfact((x-1)/3+1,p)/modfact((x-1)/6,p)/mdfact((x-1)/6+1,p);
      |                                                                       ^~~~~~
      |                                                                       modFact