#P3445. [POI 2006] TAN-Dancing in Circles

[POI 2006] TAN-Dancing in Circles

Description

nn kids attend a certain kindergarten. Everyday the kids arrange themselves in kk circles and dance.

At least ll 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 20052005. Should there beno arrangements satisfying the aforementioned conditions, the correct outcome is 00.

Write a programme which:

reads the numbers nn, kk and ll from the standard input, calculates the number d=dmod2005d'=d \bmod 2005, where dd denotes the number of distinct arrangements of the children ("dmod2005d \bmod 2005" denotes the remainder of the division of dd by 20052005), writes dd' to the standard output.

Input Format

The first and only line of the standard input contains three integers separated by single spaces: nn- the number of children (3n1093\le n\le 10^9), kk - the number of circles (1kn1\le k\le n) and ll - the minimal number of kids in a circle (2ln2\le l\le n).

Output Format

The first and only line of the standard output should contain a single integer: dmod2005d \bmod2005.

7 2 3
420