AlgoUniversity
  • Go Back
Discussion
Candles And Kids :

Author

hardik kapoor

Difficulty Level : Medium

Submissions : 72

Asked In : Jio

Marks :10

: 6 | : 0

Given N identical candles, find the number of ways to distribute them among K kids so that there is no kid with more than M candles.

Output the answer modulo 1e9+7.

Input

Input consists of 3 space separated integers, N (1 <= N <= 1e5) , K (1 <= K <= 1e5) and M (1 <= M <= 1e5).

Output

Output a single integers, the number of ways to distribute modulo 1e9+7.

Examples

Input
3 2 2
Output
2
Input
1000 1000 1000
Output
36237869

Note

There can be 2 ways for distributing, (1 , 2) and (2 , 1).

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.