#P17285. 「IXOI R2」不会说明你有鱼鱼蒸

    ID: 19634 远端评测题 2000ms 512MiB 尝试: 0 已通过: 0 显示难度省选/NOI− 上传者: 标签>递推洛谷原创O2优化生成函数洛谷月赛

「IXOI R2」不会说明你有鱼鱼蒸

Problem Description

Given n,m,kn, m, k, we call a sequence aa of length nn good if and only if:

  • ∑i=1nai=m\sum_{i=1}^n a_i = m.

  • ∑i=1n(ai mod 2)=k\sum_{i=1}^n (a_i \bmod 2) = k.

We generate aa in a special way: initially set ap←0a_p \leftarrow 0 for all pp. Then perform mm operations. In each operation, choose p∈[1,n]p \in [1, n] uniformly at random, and then set ap←ap+1a_p \leftarrow a_p + 1.

Let PP be the probability that after mm operations, the generated sequence aa is good. Compute (P⋅nm) mod 998244353(P \cdot n^m) \bmod 998244353.

Input Format

Input one line with three integers n,m,kn, m, k.

Output Format

Output one integer, the answer modulo 998244353998244353.

3 4 0
21

Hint

This problem uses bundled testdata.

Subtask Constraints Score
11 n,m≤10n, m \le 10 1010
22 m≤5000m \le 5000 2020
33 k=mk = m
44 n≤5×105n \le 5\times 10^5 2525
55 No special restrictions.

For all testdata, it is guaranteed that:

0≤n,m,k≤3×1070 \le n, m, k \le 3\times 10^7, and n≥1n \ge 1.

Translated by ChatGPT 5