#P16820. [蓝桥杯 2026 国 Python B] 控制机器人
[蓝桥杯 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 tasks and has battery level . During execution, the battery level must never be less than .
Each time, the robot can execute one of the following three commands:
- A: Complete normal task, battery level unchanged.
- B: Charge unit of battery, no task is completed.
- C: Complete high-energy task, and consume unit of battery.
Xiaolan wants that after all commands are executed, the robot has completed exactly tasks, and the remaining battery level is exactly . At the same time, the number of times the high-energy task is executed must be exactly .
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 .
Input Format
Input one line containing three integers .
Output Format
Output one integer representing the answer.
2 1 1
8
Hint
Constraints
For of the testdata, .
For of the testdata, .
For all testdata, , and .
Translated by ChatGPT 5