P16820 [Lanqiao Cup 2026 National Python B] Control Robot

Description

Xiaolan wants to write a sequence of commands for a robot to control it to complete tasks and manage its battery. At the beginning, the robot has completed $0$ tasks and has battery level $0$. During execution, the battery level must never be less than $0$. Each time, the robot can execute one of the following three commands: * A: Complete $1$ normal task, battery level unchanged. * B: Charge $1$ unit of battery, no task is completed. * C: Complete $1$ high-energy task, and consume $1$ unit of battery. Xiaolan wants that after all commands are executed, the robot has completed exactly $X$ tasks, and the remaining battery level is exactly $Y$. At the same time, the number of times the high-energy task is executed must be exactly $K$. Now please help Xiaolan compute how many different command sequences satisfy the requirements. Two command sequences are different if and only if they have different numbers of commands, or there exists some position where the commands differ. Since the answer may be very large, you only need to output the result modulo $998244353$.

Input Format

Input one line containing three integers $X, Y, K$.

Output Format

Output one integer representing the answer.

Explanation/Hint

### Constraints For $30\%$ of the testdata, $0 \le X, Y, K \le 8$. For $60\%$ of the testdata, $0 \le X, Y, K \le 5000$. For all testdata, $0 \le X, Y, K \le 10^6$, and $1 \le X + Y + K \le 2 \times 10^6$. Translated by ChatGPT 5