#include<cstdio>
#define mod 998244353
#define LL long long
#define N 300000
int n,a,b;
LL k,ans,C[N+5]={1};
LL M(LL x,LL y) { return x<y?x:y; }
LL powmod(LL x,int p)
{
	LL res=1;
	while(p)
	{
		if(p&1) res=res*x%mod;
		x=x*x%mod;
		p>>=1;
	}
	return res;
}
int main()
{
	scanf("%d%d%d%lld",&n,&a,&b,&k);
	for(int i=1;i<=n;i++) C[i]=1ll*(n-i+1)*powmod(i,mod-2)%mod*C[i-1]%mod;
	for(int i=0;i<=n&&1ll*i*a<=k;i++)
	{
		LL temp=1ll*i*a;
		if((k-temp)%b==0&&(k-temp)/b<=n)
		{
			LL x=(k-temp)/b;
			ans=(ans+C[x]*C[i])%mod;
		}
	}
	printf("%lld\n",ans);
}