2352: 「一本通 6.6 练习 5」Combination
Memory Limit:512 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
**原题来自:[BZOJ 2982](https://www.lydsy.com/JudgeOnline/problem.php?id=2982)**
LMZ 有 $n$ 个不同的基友,他每天晚上要选 $m$ 个进行 [河蟹],而且要求每天晚上的选择都不一样。那么 LMZ 能够持续多少个这样的夜晚呢?当然,LMZ 的一年有 $10007$ 天,所以他想知道答案 $\bmod 10007$ 的值。
Input
第一行一个整数 $t$,表示有 $t$ 组数据;
接下来 $t$ 行每行两个整数 $n, m$,如题意。
Output
$t$ 行,每行一个数,为 $\binom{n}{m} \bmod 10007$ 的答案。
Sample Input Copy
4
5 1
5 2
7 3
4 2
Sample Output Copy
5
10
35
6
HINT
数据范围:对于全部数据,$1\le t\le 200,1\le m\le n\le 2\times 10^8$。