#P3445. [POI2006] TAN-Dancing in Circles
[POI2006] TAN-Dancing in Circles
题目描述
kids attend a certain kindergarten. Everyday the kids arrange themselves in circles and dance.
At least kids dance in each circle. Two arrangements of children are considered distinct if there isa child who has a different right neighbour in one of the arrangements than in the other.
Your task is to calculate the number of all distinct arrangements modulo . Should there beno arrangements satisfying the aforementioned conditions, the correct outcome is .
TaskWrite a programme which:
reads the numbers , and from the standard input, calculates the number , where denotes the number of distinct arrangements of the children ( denotes the remainder of the division of by ), writes to the standard output.
幼儿园中有N个小朋友在做游戏,每天小朋友们都会有一个尬舞方案(围成K个圈尬舞)。
每个圈子里至少有L个小朋友,如果在一个方案里有一个小朋友他右面的小朋友和另一个方案里他右面的小朋友不同,那么两个尬舞方案就会被认为是不同的。
你的任务是计算所有不同的尬舞方案的数量,因为结果可能比较大,所以最后输出答案mod2005的结果。
如果没有符合要求的尬舞方案,输出0。
输入格式
The first and only line of the standard input contains three integers separated by single spaces: - the number of children (), - the number of circles() and - the minimal number of kids in a circle ().
只有一行输入,三个整数N,K,L(3≤N≤1,000,000,000 ; 1≤K≤n ; 2≤L≤n)分别代表小朋友数量,圈子数量,每个圈子里最少的小朋友数。
输出格式
The first and only line of the standard output should contain a single integer: .
只有一行输出,即合理的尬舞方案数d(mod2005)
7 2 3
420
提示
感谢@Paperback_Writer 提供翻译