BETA
nCr
Submissions: 19552   Accuracy:

22.8%

  Difficulty: Medium
       

Find nCr for given n and r.

Input:
First line contains no of test cases T, for every test case 2 integers as inputs (n,r).


Output:
Compute and print the value in seperate line. Modulus your output to 109+7. If n


Constraints:
1<=T<=50
1<=n<=1000
1<=r<=800


Example:
Input:
1
3 2

Output:
3

** For More Input/Output Examples Use 'Expected Output' option **

Author: abhiraj26


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.