#include <bits/stdc++.h>
#define ll long long
#define cal(a,b) ((a+=b)%=mo)
using namespace std;
const int N=3e5+50,mo=998244353;
int fap(int a,int b){
    int s=1;
    for (; b; b>>=1,a=1ll*a*a%mo)
	if (b&1) s=1ll*s*a%mo;
    return s;
}
int n,a,b,ans,pl[N],nl[N];
long long k;
int c(int x,int y){
    if (x<y) return 0;
    return 1ll*pl[x]*nl[y]%mo*nl[x-y]%mo;
}
int main(){
    cin>>n>>a>>b>>k;
    pl[0]=nl[0]=1;
    for (int i=1; i<=n; ++i)
	pl[i]=1ll*pl[i-1]*i%mo;
    nl[n]=fap(pl[n],mo-2);
    for (int i=n-1; i; --i)
	nl[i]=1ll*nl[i+1]*(i+1)%mo;
    for (int i=0; i<=n; ++i){
	if (1ll*i*a>k) break;
	ll s=k-1ll*i*a;
	if (s%b) continue;
	int j=s/b;
	cal(ans,1ll*c(n,j)*c(n,i)%mo);
    }
    cout<<ans;
    return 0;
}
