Redirecting to
NADOS

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.
Next T lines contain integers n and r.
Output Format
for each query print nCr mod 10^9+7 in a line.
Question Video
Constraints
1 <= T <= 10^6
1 <= n <= 3000
1 <= r <= n
Sample Input
3
4 3
5 2
10 8
Sample Output
4
10
45



  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name