#P16820. [蓝桥杯 2026 国 Python B] 控制机器人

    ID: 19161 远端评测题 3000ms 512MiB 尝试: 0 已通过: 0 显示难度普及+/提高− 上传者: 标签>数学组合数学2026蓝桥杯国赛

[蓝桥杯 2026 国 Python B] 控制机器人

Problem 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 00 tasks and has battery level 00. During execution, the battery level must never be less than 00.

Each time, the robot can execute one of the following three commands:

  • A: Complete 11 normal task, battery level unchanged.
  • B: Charge 11 unit of battery, no task is completed.
  • C: Complete 11 high-energy task, and consume 11 unit of battery.

Xiaolan wants that after all commands are executed, the robot has completed exactly XX tasks, and the remaining battery level is exactly YY. At the same time, the number of times the high-energy task is executed must be exactly KK.

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 998244353998244353.

Input Format

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

Output Format

Output one integer representing the answer.

2 1 1
8

Hint

Constraints

For 30%30\% of the testdata, 0≤X,Y,K≤80 \le X, Y, K \le 8.

For 60%60\% of the testdata, 0≤X,Y,K≤50000 \le X, Y, K \le 5000.

For all testdata, 0≤X,Y,K≤1060 \le X, Y, K \le 10^6, and 1≤X+Y+K≤2×1061 \le X + Y + K \le 2 \times 10^6.

Translated by ChatGPT 5