#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=1444999999994; ll mod=998244353; const int MAX = 610000; const int MOD = mod; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } int main(){ ll n,m,a,b; cin >> n >> m >> a >> b; vectorx(m,0); COMinit(); for (ll i = n-1; i >=0; i--) { if (i*a+(n-1-i)*(b+1)>=m) { break; } ll y=i*a+(n-1-i)*(b+1); x[y]=COM(n-1,i); if ((n-1-i)%2) { x[y]*=-1; x[y]+=mod; x[y]%=mod; } } vectory(m+1,0); for (ll i = 0; i <=m; i++) { y[i]=COM(n-2+i,n-2); } vectorz=convolution<998244353>(x,y); ll ans=0; vectorkaijo(n+100,1); for (ll i = 1; i < kaijo.size(); i++) { kaijo[i]=kaijo[i-1]*i; kaijo[i]%=mod; } for (ll i = 0; i b) { continue; } ans+=(((z[i]*(m-i))%mod)*kaijo[n])%mod; ans%=mod; } cout << ans << endl; }