MAY99_4  Rachu
Rachu is very happy today beacause its his birthday :D and he has a bday party at home with 'r' friends.
He went to market to purchase something to eat .(He is really fond of eating :P ).
At the shop he found muffins at a very reasonable price (ohh!! he loves muffins ;) ).
He bought 'n' muffins from the shop.
After reaching home he is wondering that in how many ways he can distribute these muffins between his friends .
He shouldn't be rash so he would give atleast 1 muffin to each friend.
For rest of the muffins left he can distribute it in any manner. He is still wondering the no. of ways in which he can distribute these muffins.
Help him out by writing a code which calculates the no. of ways the muffins could be distributed and print "1" (quotes for clarity) if its impossible for him to distribute the muffins.
Consider each muffin as similar. The no. of ways could go very large so output the reult after taking a mod with 10000007 .
Input
The input consists of 2 integers :
n : The no. of muffins
r : The no. of friends
Output
The required answer modulo 10000007
Constraints
1<= n,r <= 100
Example
Input: 2 1 Output: 1Input: 4 2 Output:
3Explanation
In 1st case he has 2 muffins and called only 1 friend so he gave both the muffins to him .
In 2nd case he 1st give 1 muffin each to both.
Then he can give 0 muffin to 1st friend and 2 to the 2nd or 1 muffin to each or 2 muffins to 1st friend and 0 to the 2nd.
hide comments
viratian_070:
20170701 06:42:53
easy stuff...but remember printing "1" 

heisenberg0820:
20170622 15:19:02
100th :) 

sas1905:
20170523 17:12:25
when n<r print 1 not zero costed me two WA's..hardly 56 lines in python.. 

.::Austin::.:
20160710 23:16:04
IIT JEE mathematics :D 

Piyush Kumar:
20160612 14:16:51
This is not DP, this is basic Combinatorics, and the with the given constraints, it is too easy in python! 

Arjav Patel:
20160116 16:28:07
Easy one with dp! 

RADHE SHYAM LODHI:
20150829 09:28:11
green after 1 RE, 4WA, 3TLE :D


Bhuvnesh Jain:
20150716 21:19:28
constraints were too less to learn something at all.... atleast n, r should be about 10^5 and time limit more struct as there is only one test only in each file..... if constraints not changed.... problems should be moved to tutorials..... 

mrx:
20150711 14:19:46
lol no such big things required, just see the pattern which you obtain. 

Shashank Tiwari:
20150706 19:19:16
1) 10000007 = 941*10627 ; where 941 , 10627 are prime.

Added by:  Mayank Tuteja 
Date:  20130118 
Time limit:  0.179s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  ASM32GCC MAWK BC CCLANG C CPP C++ 4.3.2 CPP14CLANG CPP14 COBOL COFFEE DDMD DCLANG DART ELIXIR FANTOM FORTH GOSU GRV JAVA JSMONKEY KTLN NIM OBJC OBJCCLANG OCT PICO PROLOG PYPY R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET 
Resource:  Gunjit Agrawal 