QOJ.ac

QOJ

時間限制: 1.0 s 記憶體限制: 512 MB 總分: 100 可 Hack ✓

#12602. 朱大师与多边形

统计

考虑一个有 $N$ 个顶点的正多边形,其中 $N$ 为奇数。顶点按圆周顺序编号为 $1$ 到 $N$。我们可以从中选择 $M$ 个顶点来构成一个凸多边形。Master Zhu 希望你求出有多少种可能的凸多边形恰好有 $K$ 个锐角。由于数量可能非常大,请输出答案对 $10^9 + 7$ 取模的结果。如果两个多边形所选顶点的集合不同,则认为它们是不同的。

输入格式

第一行包含一个整数 $T$,表示测试用例的数量 ($1 \le T \le 5 \cdot 10^4$)。

每个测试用例由一行组成,包含三个整数 $N$、$M$ 和 $K$ ($3 \le N \le 10^6$, $3 \le M \le N$, $0 \le K \le M$, 且 $N$ 为奇数)。

输出格式

对于每个测试用例,在单独的一行中输出答案对 $10^9 + 7$ 取模的结果。

样例

样例输入 1

1
5 4 2

样例输出 1

5

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.