#P8725. [蓝桥杯 2020 省 AB3] 画中漂流
[蓝桥杯 2020 省 AB3] 画中漂流
Problem Description
In a dream, you step onto a wooden boat and drift on a river.
Based on what you know about the area, you know there is a canyon meters downstream. If you move downstream by at least meters, you will definitely die.
Now you have called emergency services. After seconds, the rescue team will arrive and pull you ashore. The water flows at a speed of . You currently have stamina points. Each time you spend stamina point, you can row for one second and make the boat move upstream; otherwise, you will move downstream (because of the current). All stamina points must be used up before the rescue team arrives. Because the river is too wide, you cannot get ashore by your own strength.
How many different rowing plans can allow you to survive?
Two rowing plans are considered different if there exists some second such that one plan rows during that second while the other plan does not.
Input Format
One line contains three integers , , and .
Output Format
Output one integer, the total number of plans that allow you to survive. The answer may be very large, so output the result modulo (i.e., ).
1 6 3
5
Hint
For of the testdata, .
For all testdata, , , .
Lanqiao Cup 2020, Round 3 Provincial Contest, AB Group, Problem I.
Translated by ChatGPT 5