
124  ZOJ Monthly, March 2013  E
There are n people standing in a row. And There are m numbers, 1.2...m. Every one should choose a number. But if two persons standing adjacent to each other choose the same number, the number shouldn't equal or less than k. Apart from this rule, there are no more limiting conditions. And you need to calculate how many ways they can choose the numbers obeying the rule. InputThere are multiple test cases. Each case contain a line, containing three integer n (2 ≤ n ≤ 10^{8}), m (2 ≤ m ≤ 30000), k(0 ≤ k ≤ m). OutputOne line for each case. The number of ways module 1000000007. Sample Input4 4 1 Sample Output216 Author: GU, Shenlong 