#include #include #include using namespace std; using mint = atcoder::modint998244353; using i64 = long long; mint fact[1000010]; mint ifact[1000010]; mint binom(int n, int r) { if (n < 0 || r < 0 || n < r) return 0; return fact[n] * ifact[r] * ifact[n - r]; } void solve() { int n, k; cin >> n >> k; if (k == 0) { cout << 1 << "\n"; return; } mint invk = mint(k).inv(); mint ans = 0; for (int p = 1; p <= 2 * k; p += 2) { int l = (p + 1) / 2; mint tmp = binom(2 * k + n - p, n - p); tmp *= binom(k, l) * binom(k, l - 1) * invk; ans += tmp; } cout << ans.val() << "\n"; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int t; // cin >> t; t = 1; fact[0] = 1; for (int i = 1; i <= 1000000; i++) { fact[i] = fact[i - 1] * i; } ifact[1000000] = fact[1000000].inv(); for (int i = 1000000; i > 0; i--) { ifact[i - 1] = ifact[i] * i; } while (t--) solve(); }