#include<iostream>
using namespace std;
const int maxn = 3e5 + 5;
const int MOD = 998244353;
#define LL long long
LL n,a,b,k;
LL fac[maxn];
LL inv[maxn];
LL C(LL x){
    return (fac[n] * inv[x]%MOD) *inv[n-x] %MOD;
}
int main()
{
    cin>>n>>a>>b>>k;
    if(k == 0){
        cout<<1<<endl;
        return 0;
    }
    fac[0]=inv[0]=inv[1]=1;
	for (int i=2;i<=n;i++)
		inv[i]=1ll*inv[MOD%i]*(MOD-MOD/i)%MOD;
	for (int i=1;i<=n;i++){
		fac[i]=1ll*fac[i-1]*i%MOD;
		inv[i]=1ll*inv[i-1]*inv[i]%MOD;
	}
	LL ans = 0;
    for(int red = 0;red<=n;red++){
        LL rest = k - red * a;
        LL blue = rest / b;
        if(rest % b == 0 && blue <= n && rest >= 0){
            ans = (ans + C(red) * C((LL)rest / b)) % MOD;
        }
    }
    cout<<ans<<endl;
    return 0;
}