#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const ll MOD = 998244353;

ll ncr[300005];
ll fact[300005];
ll inv[300005];

ll ex(ll a, ll b)
{
	if (b == 0) return 1;
	ll r = ex(a, b>>1);
	r *= r; r %= MOD;
	if (b&1) r = (r*a)%MOD;
	return r;
}

int main()
{
	ll n, a, b, k, ans = 0;
	cin >> n >> a >> b >> k;

	fact[0] = 1; inv[0] = 1;
	for (ll i = 1;i <= n;i++)
	{
		fact[i] = fact[i-1]*i; fact[i] %= MOD;
		inv[i] = ex(fact[i], MOD-2);
	}
	for (ll i = 0;i <= n;i++)
	{
		ncr[i] = fact[n]*inv[i];
		ncr[i] %= MOD;
		ncr[i] *= inv[n-i];
		ncr[i] %= MOD;
	}

	for (ll i = 0;i <= n;i++)
	{
		ll rem = k-i*a;
		if (rem >= 0 && rem%b == 0 && rem/b <= n)
		{
			ans += ncr[i]*ncr[rem/b];
			ans %= MOD;
		}
	}
	cout << ans << endl;
	return 0;
}
