Language: C++

#include<bits/stdc++.h>
#define ll unsigned long long
using namespace std;

ll fac[maxn],inv[maxn];
ll n,a,b,k;
ll qpow(ll a,ll b)
{
    ll res=1;
    while(b)
    {
        if(b&1)
        {
            res=(res*a)%mod;
        }
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}
void init()
{
    fac[0]=1;
    for(ll i=1;i<=n+1;i++)
        fac[i]=(fac[i-1]*i)%mod;
    inv[n+1]=qpow(fac[n+1],mod-2);
    for(ll i=n;i>=0;i--)
        inv[i]=(inv[i+1]*(i+1))%mod;
}
ll C(ll x,ll y)
{
    if(!x&&!y)
        return 1;
    if(x<y)
        return 0;
    return fac[x]*inv[y]%mod*inv[x-y]%mod;
}

int main (){

    int n,a,b;
    ll k,ans=0;
    scanf("%d %d %d %lld",&n,&a,&b,&k);
    init();
    if(k==0) { puts("1"); return 0;}
    for(int  x=1;x<=n;x++){
        ll temp=k-a*x;
        if(temp<0)
            continue;
        ll y=temp%b;
        if(y==0)
        {
            ans=(ans+C(n,x)*1ll%mod*C(n,y)*1ll%mod)%mod;
        }
    }
    printf("%I64d\n",ans);
    return 0;
}


Compiler output:
a.cc:5:8: error: 'maxn' was not declared in this scope
    5 | ll fac[maxn],inv[maxn];
      |        ^~~~
a.cc:5:18: error: 'maxn' was not declared in this scope
    5 | ll fac[maxn],inv[maxn];
      |                  ^~~~
a.cc: In function 'long long unsigned int qpow(long long unsigned int, long long unsigned int)':
a.cc:14:25: error: 'mod' was not declared in this scope; did you mean 'modf'?
   14 |             res=(res*a)%mod;
      |                         ^~~
      |                         modf
a.cc:16:17: error: 'mod' was not declared in this scope; did you mean 'modf'?
   16 |         a=(a*a)%mod;
      |                 ^~~
      |                 modf
a.cc: In function 'void init()':
a.cc:23:5: error: 'fac' was not declared in this scope
   23 |     fac[0]=1;
      |     ^~~
a.cc:25:29: error: 'mod' was not declared in this scope; did you mean 'modf'?
   25 |         fac[i]=(fac[i-1]*i)%mod;
      |                             ^~~
      |                             modf
a.cc:26:5: error: 'inv' was not declared in this scope; did you mean 'int'?
   26 |     inv[n+1]=qpow(fac[n+1],mod-2);
      |     ^~~
      |     int
a.cc:26:28: error: 'mod' was not declared in this scope; did you mean 'modf'?
   26 |     inv[n+1]=qpow(fac[n+1],mod-2);
      |                            ^~~
      |                            modf
a.cc: In function 'long long unsigned int C(long long unsigned int, long long unsigned int)':
a.cc:36:12: error: 'fac' was not declared in this scope
   36 |     return fac[x]*inv[y]%mod*inv[x-y]%mod;
      |            ^~~
a.cc:36:19: error: 'inv' was not declared in this scope; did you mean 'int'?
   36 |     return fac[x]*inv[y]%mod*inv[x-y]%mod;
      |                   ^~~
      |                   int
a.cc:36:26: error: 'mod' was not declared in this scope; did you mean 'modf'?
   36 |     return fac[x]*inv[y]%mod*inv[x-y]%mod;
      |                          ^~~
      |                          modf
a.cc: In function 'int main()':
a.cc:53:33: error: 'mod' was not declared in this scope; did you mean 'modf'?
   53 |             ans=(ans+C(n,x)*1ll%mod*C(n,y)*1ll%mod)%mod;
      |                                 ^~~
      |                                 modf