Itami has bought
However, they are very picky about the amount of candies that they eat. Lelei only wants a prime number of candies, Rory wants candies in multiples of
In how many different ways can Itami distribute his bag of candies? A distribution is considered different if at least one of his friends gets a different amount of candy. Note that Itami does not have to distribute all
Note
A prime number is a positive integer greater than
A multiple of a number
Input Specification
The first line of input will contain two space-separated integers
Output Specification
A single integer, the number of ways Itami can hand out his candies.
Sample Input 1
3 1
Sample Output 1
4
Explanation for Sample Output 1
The ways of distributing are, in order of
Sample Input 2
1 1
Sample Output 2
0
Explanation for Sample Output 2
Lelei must take at least
Sample Input 3
10 3
Sample Output 3
19
Comments
Hi All,
I have tested my code with all the test cases and it seems to be working fine. However, it is very inconsistent within the batches.It would be great if someone can offer a hint.
Thanks!
I think you forgot to take into consideration the case where there is not enough candy left to give to Tuka.
I included the two cases: one Tuka takes one candy, and the other one he does not. Are you sure that is the problem? Thanks!
Multiples can't be negative right?
Each person must get zero or more candies.
This comment is hidden due to too much negative feedback. Show it anyway.
No comment. Read the task description again.
This comment is hidden due to too much negative feedback. Show it anyway.