시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 | 512 MB | 10 | 4 | 4 | 40.000% |
n kids attend a certain kindergarten. Everyday the kids arrange themselves in k circles and dance. At least l kids dance in each circle. Two arrangements of children are considered distinct if there is a 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 2005. Should there be no arrangements satisfying the aforementioned conditions, the correct outcome is 0.
Write a programme which:
The first and only line of the standard input contains three integers separated by single spaces: n - the number of children (3 ≤ n ≤ 1,000,000,000), k - the number of circles (1 ≤ k ≤ n) and l - the minimal number of kids in a circle (2 ≤ l ≤ n).
The first and only line of the standard output should contain a single integer: dmod2005.
7 2 3
420