QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 1024 MB Points totaux : 100

#11201. 聊天群

Statistiques

据说一个有 6 个人的宿舍有 7 个聊天群 ^_^。但这个数字可能会更大:因为每 3 个人或更多人就可以组成一个聊天群,所以总共可以有 42 个不同的聊天群。

给定宿舍里的 $N$ 个人,且每 $K$ 个人或更多人就可以组成一个聊天群,总共可以有多少个不同的聊天群?

输入格式

输入的第一行包含一个整数 $T$,表示测试用例的数量。

每个测试用例包含一行,其中有两个整数 $N$ 和 $K$,分别表示宿舍里的人数以及组成一个聊天群所需的最少人数。

输出格式

对于每个测试用例,输出一行 “Case #x: y”,其中 $x$ 是测试用例的编号(从 1 开始),$y$ 是不同聊天群的数量对 $1000000007$ 取模的结果。

数据范围

  • $1 \le T \le 100$
  • $1 \le N \le 10^9$
  • $3 \le K \le 10^5$

样例

输入 1

1
6 3

输出 1

Case #1: 42

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.