Language: C++

#include <bits/stdc++.h>
#include <bitset>

#define REP(i,n) for(int i=0;i<(int)n;i++)
#define REP1(i,j,n) for(int i=j;i<(int)n;i++)
#define pb(x) push_back(x)
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define double long double
#define mp(x,y) make_pair(x,y)

typedef long long ll;

using namespace std;


 const int MAX = 5 * 100000 + 1;
 int fact [MAX];
     int MOD = 998244353;
     ll inv(ll x , ll mod){
        ll r, y;
        for(r = 1 , y = mod - 2 ; y != 0 ;x = x * x % mod, y>>=1)
            if ((y & 1) == 1)
                r = r * x % mod;
        return r;
    }
     int ncr (int n, int r) {
     	// cerr<<n<<" "<<r<<"\n";
     	if(r==0)return 1;
        return (int)((ll)fact[n] * ((inv(fact[r], MOD) * inv(fact[n - r], MOD)) % MOD) % MOD) % MOD;
    }
     
     void factorial () {
        fact[0] = fact[1] = 1;
        for (int i = 2; i < MAX; i++)
            fact[i] = (int)((ll)i * fact[i - 1] % MOD);
    }

ll sum[MAX];
ll mem[MAX];


int main() {

        
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    ll n,A,B,k;
    // cerr<<"sadf\n";
    cin>>n>>A>>B>>k;
    memset(mem,-1,sizeof mem);
    for(int a=n;a>=0;a--){
    	sum[a]=1ll*ncr(n,a)*ncr(n,n-a)%MOD;
    	if(a!=n)sum[a]+=sum[a+1];
    }
    factorial();
    int MOD=998244353;
    ll res=0;
    REP(a,n+1){
    	ll r=k-a*A;
    	if(r%B==0){
    		ll b=r/B;
    		if(max(a,b)<=n)res+=1ll*ncr(n,a)*ncr(n,b)%MOD;
    		// cerr<<res<<"\n";
    		res%=MOD;
    	}
    }
    cout<<res<<"\n";
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:23: error: no matching function for call to 'max(int&, ll&)'
   65 |                 if(max(a,b)<=n)res+=1ll*ncr(n,a)*ncr(n,b)%MOD;
      |                    ~~~^~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:65:23: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   65 |                 if(max(a,b)<=n)res+=1ll*ncr(n,a)*ncr(n,b)%MOD;
      |                    ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:65:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   65 |                 if(max(a,b)<=n)res+=1ll*ncr(n,a)*ncr(n,b)%MOD;
      |                    ~~~^~~~~