编程介的小学生 2017-08-02 09:15 采纳率: 20.5%
浏览 764
已采纳

Round Table

Problem Description
I have m little buddies, and tonight we will have a fancy dinner in my room.
Fortunately, I have a round table which is large enough for all my little buddies. (As for me, I will not sit in the round table for some reasons) And the round table is so large that I will not let my little buddies sit shoulder to shoulder.
That means I will select m seats from n seats, and there maximal length of consecutive seats in the original round table won't be larger than or equal to k. I want know how many different ways I can choose.
Here is one more thing, two ways are considered the same if and only if one can be obtained by rotation.

The answer may be very large so the answer should modulo 109 + 7.

Input
The first line has a number T (T <= 200) , indicating the number of test cases.
Next each line contain three integer n, m, k (1 <= n <= 105, 1 <= m <= 105, 2 <= k <= 105, m <= n).

Output
For every case, you should output "Case #t: " at first, without quotes. The t is the case number starting from 1.
Then follows the answer, See the sample for more details.

Sample Input
3
3 1 2
5 2 2
8 3 2

Sample Output
Case #1: 1
Case #2: 1
Case #3: 2

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-08-16 16:29
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿