QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 512 MB Total points: 100

#6204. 押韵

Statistics

韵要怎么押?棋要怎么下?敌要怎么杀?旗要怎么插?

现在你想要写一首歌词,一共有 $nd$ 个字,你一共设计了 $k$ 种韵脚,每个字恰好要符合一种韵脚。并且只有当每种韵脚在歌词中出现的字数恰为 $d$ 的倍数时,这首歌才好听。试问一共有多少种韵脚的搭配方法,使得歌词好听?你只需要回答方案数对于 $1049874433$ 取模的结果即可。

输入格式

第一行三个整数 $n, k, d$,如题意所示。

输出格式

一行一个整数,表示答案。

样例一

input

2 2 2

output

8

样例二

input

2 3 4

output

213

样例三

input

2 4 6

output

5548

限制与约定

对于 $100\%$ 的数据,保证 $0\le n\le 10^9, 1\le k\le 2000, d \in \{1, 2, 3, 4, 6\}$。

测试点编号$n$$k$$d$
$1$$\le 5\times 10^4$$\le 2\times 10^3$$2$
$2$$3$
$3$$4$
$4$$6$
$5$$\le 10^9$$1$
$6$
$7$$2$
$8$
$9$$3$
$10$
$11$$\le 10^3$$4$
$12$
$13$$\le 2\times 10^3$
$14$
$15$$\le 10^3$$6$
$16$
$17$
$18$
$19$$\le 2\times 10^3$
$20$
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.