P20651 [Kattis] Arrangingwine
提高
题目描述

The host university is organizing a party for this year’s ACM/ICPC contestants with a buffet dinner and $R$ boxes of red wine and $W$ boxes of white wine. Wine boxes are to be arranged into non-empty piles, each pile contains only one type of wine, either white or red. After that, those piles are put into a line so that no two piles belonging to the same kind sit next to each other. In addition, for security reasons, each red wine pile should not have more than $d$ boxes of red wine, although piles of white wine can be arbitrarily large.

Your task is to identify $K$ - the number of different ways to arrange the given wine boxes satisfying all of the above conditions.

-----Input-----
The input contains $3$ space separated integers in one line: $R$, $W$, $d$ $(1 \leq R,W \leq 10^6, 1 \leq d \leq R)$

-----Output-----
Write in one line the remainder of $K$ divided by $10^9+7$.

-----Sample Clarification-----
In the first sample below, there are $3$ valid arrangements:

In the second sample below, there are $6$ valid arrangements:

-----Examples-----
Sample Input:
2 2 1
Sample Output:
3

输入格式

见题面

输出格式

见题面

样例输入
2 2 1
样例输出
3