#include #include using namespace std; const int MOD = 998244353; int main(){ const int maxSize = 500001; vector inv(maxSize); vector fact(maxSize); vector factInv(maxSize); for(int i=0;i<2;i++) inv[i] = fact[i] = factInv[i] = 1; for(int i=2;i> N >> M >> A >> B){ long long res = 0; for(int i=A;i<=B;i++){ long long sel = i-(N-1)*A; if(sel < 0) continue; res += comb(sel+N-2, N-2) * fact[N] % MOD * (M-i) % MOD; res %= MOD; } cout << res << endl; } }