QOJ.ac

QOJ

时间限制: 1 s 内存限制: 32 MB 总分: 100

#482. 圆圈舞

统计

有 $n$ 个孩子在幼儿园。每天孩子们会排成 $k$ 个圆圈跳舞。每个圆圈中至少有 $l$ 个孩子。如果一个孩子在两种排列中的右侧邻居不同,则认为这两种排列是不同的。

你的任务是计算所有不同排列的数量,结果对 $2005$ 取模。如果没有满足上述条件的排列,则正确结果为 $0$。

编写一个程序:

  • 从标准输入读取数字 $n$、$k$ 和 $l$。
  • 计算数字 $d' = d \bmod 2005$,其中 $d$ 表示孩子们的不同排列总数($d \bmod 2005$ 表示 $d$ 除以 $2005$ 的余数)。
  • 将 $d'$ 写入标准输出。

输入格式

标准输入的第一行也是唯一一行包含三个由空格分隔的整数:$n$(孩子数量,$3 \le n \le 1\,000\,000\,000$)、$k$(圆圈数量,$1 \le k \le n$)和 $l$(每个圆圈中最少的孩子数量,$2 \le l \le n$)。

输出格式

标准输出的第一行也是唯一一行应包含一个整数:$d \bmod 2005$。

样例

输入格式 1

7 2 3

输出格式 1

420

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.