In the city CCO, there are bus stations in a line, which are numbered from left to right as station
to station
. The distance between two adjacent stations is exactly
km. Bruce is planning the bus routes. He needs to guarantee that the designed bus routes satisfy the following rules.
- Suppose that there are
buses in total. The stations
to
must be the initial stations, while the stations
to
must be the terminal stations.
- For each station (including initial station and terminal station), exactly one bus stops at that station.
- Every bus only drives from left to right.
- For each bus, the two adjacent stops cannot be greater than
km.
Given the above rules, Bruce wants to know the total number of ways to design the bus routes. Since the number may be large, please compute it modulo .
Input Specification
One line input, ,
,
, represent the number of bus stations, the number of buses, and the distance limit between two adjacent bus stops, respectively. (
,
,
,
).
Output Specification
One integer, the number of ways to design the bus routes mod .
Sample Input 1
10 3 3
Sample Output 1
1
Sample Input 2
5 2 3
Sample Output 2
3
Sample Explanation
In sample input 1, there is only valid plan
.
In sample input 2, there are valid plans
,
,
.
Comments