Number Of Ways
All submissions for this problem are available.
John wanted to buy gifts for some k children in his apartments on christmas. He goes to the shop and the shopkeeper shows him n gifts. How many ways John can choose k gifts from n total gifts ?. Since answer could be large print the answer mod 1000000007
NOTE : ordering of the gifts do not matter Different order of same set of gifts are considered same and should not be counted as different
The first line of the input contains an integer t, number of test cases next t lines follow with each line containing two integers (n and k) separated by space.
For each test case print the answer in a new line.
0 < n <= 100000
1< k <= 100000
1 < t <= 100
1 5 1Output:
Example case .you can chose any one of the five gifts.so 5 ways
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.