import kotlin.math.min fun main() { val mod = 998244353 val (n, m, a, b) = readLine()!!.trim().split(' ').map(String::toInt) val factorial = LongArray(m + n + 1){1L} val div = LongArray(m + n + 1){1L} val inverse = LongArray(m + n + 1){1L} for (i in 2 until factorial.size) { factorial[i] = i * factorial[i - 1] % mod div[i] = (mod - mod / i) * div[mod % i] % mod inverse[i] = div[i] * inverse[i - 1] % mod } val combination = {n: Int, r: Int -> if (n >= r) factorial[n] * inverse[r] % mod * inverse[n - r] % mod else 0 } val result = (1 .. m).map {smaller -> val greater = min(smaller + b, m) val diff = greater - a * n.toLong() + a - smaller if (diff >= 0) combination(diff.toInt() + n - 1, n - 1) else 0 } println(result.sum() % mod * factorial[n] % mod) }