#P8725. [蓝桥杯 2020 省 AB3] 画中漂流

    ID: 9829 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 5 上传者: 标签>动态规划 DP2020容斥原理蓝桥杯省赛

[蓝桥杯 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 DD meters downstream. If you move downstream by at least DD meters, you will definitely die.

Now you have called emergency services. After TT seconds, the rescue team will arrive and pull you ashore. The water flows at a speed of 1 m/s1 \mathrm{~m} / \mathrm{s}. You currently have MM stamina points. Each time you spend 11 stamina point, you can row for one second and make the boat move 1 m1 \mathrm{~m} upstream; otherwise, you will move 1 m1 \mathrm{~m} downstream (because of the current). All MM 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 DD, TT, and MM.

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 10000000071000000007 (i.e., 109+710^9+7).

1 6 3
5

Hint

For 50%50\% of the testdata, 1T3501 \leq T \leq 350.

For all testdata, 1T30001 \leq T \leq 3000, 1DT1 \leq D \leq T, 1M15001 \leq M \leq 1500.

Lanqiao Cup 2020, Round 3 Provincial Contest, AB Group, Problem I.

Translated by ChatGPT 5