AlgoUniversity
  • Go Back
Discussion
Countit :

Author

Ujjwal Rana

Difficulty Level : Easy

Submissions : 287

Asked In : Walmart

Marks :10

: 6 | : 0

Count the number of ways to distribute $$$S$$$ candies to $$$3$$$ children such that no child gets more than $$$K$$$ candies.

Input

First line contains 2 integers $$$K \leq 5000$$$ and $$$S \leq 3*K$$$ respectively

Output

Print the number of ways of distributing candies

Examples

Input
5 15
Output
1
Input
1 2
Output
3

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.