Problem2605--求组合数

2605: 求组合数

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 0
[Status] [Submit] [Creator:]

Description

有N个任务,每个任务是求一个组合数。

Input

第1行输入一个正整数N<1000000。
第2到第N+1行,每行2个正整数x和y,表示要计算组合数C(x,y),保证x>=y, x<1000。

Output

N行,每行一个组合数C(x,y),由于答案可能很大,输出答案模10007的结果

Sample Input Copy

3
6 3
10 7
20 8

Sample Output Copy

20
120
5886

Source/Category