QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 256 MB Points totaux : 100

#13833. Birthday Party

Statistiques

Today is hidadz's birthday, and she has invited many friends to her birthday party.

hidadz brings her friends to the garden, intending to have them sit in a row to play a game. To ensure the game is not boring, the seating arrangement must satisfy the following condition:

For any contiguous segment, the absolute difference between the number of boys and the number of girls must not exceed $k$.

Soon, the children find one such arrangement and begin the game. hidadz's good friend Susie discovers that there are actually many such seating arrangements. Since they found one so quickly, they begin to wonder: exactly how many such arrangements are there? The math-loving hidadz and her friends start to ponder this question...

Assuming there are $n$ boys and $m$ girls at the party, can you answer Susie and hidadz's question? Since this number can be very large, they only want to know the remainder when this number is divided by $12345678$.

Input

The input contains a single line with three integers: the number of boys $n$, the number of girls $m$, and the constant $k$.

Output

The output should contain a single line representing the answer required by the problem.

Examples

Input 1

1 2 1

Output 1

1

Constraints

For 30% of the data, $n, m \le 20$; For 100% of the data, $n, m \le 150$, $k \le 20$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.