시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB104440.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:

  • reads the numbers n, k and l from the standard input,
  • calculates the number d’=d mod 2005, where  denotes the number of distinct arrangements of the children (dmod2005 denotes the remainder of the division of d by 2005),
  • writes d’ to the standard output.

입력

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.

예제 입력 1

7 2 3

예제 출력 1

420