#nt502. 组合数取模1
组合数取模1
Binomial Coefficient Modulo (1)
Problem Description
Answer test cases. For each case, output the value of .
Input Format
The first line contains an integer , the number of test cases.
For each test case, a line contains two integers .
Output Format
For each test case, output one line containing the answer.
Sample Input
3
5 2
50 20
500 200
Sample Output
10
211914057
395607423
Constraints
For all data, and are guaranteed.