import strutils, sequtils, sugar, times var n, x: int64 (n, x) = stdin.readLine.split.map(parseInt) assert 1 <= n and n <= 499122176 assert 1 <= x and x <= 400000 const MOD = 998244353i64 var cv = newSeq[(char, int64)](x) for i in 0.. 1: let q = (MOD + (abs(z) shr 1)) div z z = MOD - q * z x = -x * q mod MOD if z < 0: x = -x if x < 0: x = x + MOD x var ans = 0i64 if r_sum > 0: let n = r_sum div 2 ans += n * (n - 1) mod MOD * inv(6) if b_sum > 0: let n = b_sum div 2 ans += n * (n - 1) mod MOD * inv(6) if r_sum > 0 and b_sum > 0: ans += cross() * inv((r_sum - 1) * (b_sum - 1) mod MOD) ans = ans mod MOD if ans < 0: ans += MOD echo ans