You are given zeros and ones. Your task is to find the number of ways to arrange them into one sequence such that the absolute difference between the number of zeros and the number of ones for any consecutive interval is not greater than . Since the answer is huge, output the answer .
Input Specification
The first line contains three integers , and (, , ), representing the number of zeros, the number of ones, and the maximum allowed absolute difference between zeros and ones in any interval, respectively.
Output Specification
Output a single integer representing the number of ways .
Constraints
Subtask | Points | Additional constraints |
---|---|---|
, , | ||
, , | ||
No additional constraints |
Sample Input 1
4 2 2
Sample Output 1
4
Explanation
Given zeroes and ones, there are ways: , , , .
Sample Input 2
1 2 1
Sample Output 2
1
Sample Input 3
4 2 1
Sample Output 3
0
Comments