Logo
(追記) (追記ここまで)

8132번 - Dancing in Circles 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB226642.857%

문제

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

힌트

출처

Olympiad > Polish Olympiad in Informatics > POI 2005/2006 > Stage 3 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /