#include <bits/stdc++.h>

using namespace std;

inline int inv(int n, int p) {
	int i = 1;
	for (int r = n; r > 1; r = p % r)
		i = p / r * long(p - i) % p;
	return i;
}
long c[333333];
int main()
{
	int n, a, b;
	long k;
	cin >> n >> a >> b >> k;
	int p = 998244353;
	c[0] = 1;
	for (int i = 0; i < n; i++)
		c[i + 1] = long(n - i)*inv(i + 1, p) % p*c[i] % p;
	long r = 0;
	for (int i = 0; i <= n; i++) {
		long x = k - long(i)*a;
		if (x%b || x<0 || x / b>n) continue;
		r += c[i] * c[x / b];
		r %= p;
	}
	cout << r << endl;
	return 0;
}
