G. 「一本通 6.6 练习 5」Combination

    Type: Default 1000ms 512MiB

「一本通 6.6 练习 5」Combination

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

原题来自:BZOJ 2982

LMZ 有 nn 个不同的基友,他每天晚上要选 mm 个进行 [河蟹],而且要求每天晚上的选择都不一样。那么 LMZ 能够持续多少个这样的夜晚呢?当然,LMZ 的一年有 1000710007 天,所以他想知道答案 mod10007\bmod 10007 的值。

输入格式

第一行一个整数 tt,表示有 tt 组数据;

接下来 tt 行每行两个整数 n,mn, m,如题意。

输出格式

tt 行,每行一个数,为 (nm)mod10007\binom{n}{m} \bmod 10007 的答案。

样例

4
5 1
5 2
7 3
4 2
5
10
35
6

数据范围与提示

对于全部数据,1t200,1mn2×1081\le t\le 200,1\le m\le n\le 2\times 10^8

中学生信息奥林匹克(提高)作业——组合数学

Not Claimed
Status
Done
Problem
12
Open Since
2025-12-13 11:30
Deadline
2026-1-24 23:59
Extension
24 hour(s)