Modular C(n,r)
You have T test cases and for each test case you have been given n and r values and you need to find nCr mod 10^9+7.Input Format
The first line contains an integer T.Output Format
Next T lines contain integers n and r.
for each query print nCr mod 10^9+7 in a line.Question Video
1 <= T <= 10^6Sample Input
1 <= n <= 3000
1 <= r <= n
3Sample Output
4 3
5 2
10 8
4
10
45
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run