#include<bits/stdc++.h>
#define y1 wzpakking
#define ll long long
#define pa pair<int,int>
#define mo 998244353
using namespace std;
const int N=300005;
int fac[N],inv[N];
int n,a,b,ans;
long long k;
int C(int x,int y){
	return 1ll*fac[x]*inv[y]%mo*inv[x-y]%mo;
}
int main(){
	scanf("%d%d%d%lld",&n,&a,&b,&k);
	fac[0]=inv[0]=inv[1]=1;
	for (int i=2;i<=n;i++)
		inv[i]=1ll*inv[mo%i]*(mo-mo/i)%mo;
	for (int i=1;i<=n;i++){
		fac[i]=1ll*fac[i-1]*i%mo;
		inv[i]=1ll*inv[i-1]*inv[i]%mo;
	}
	for (int red=0;red<=n;red++){
		long long rest=k-1ll*red*a;
		if (rest<0||rest>1ll*b*n||rest%b) continue;
		int blue=rest/b;
		ans=(ans+1ll*C(n,red)*C(n,blue))%mo;
	}
	printf("%d",ans);
	return 0;
}