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

10961번 - School canteen 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 256 MB87291930.159%

문제

Once upon a time, there was a school canteen. And the cooks were very busy there. They had to prepare a menu for all n days of the school year, but they had to admit that they are able to make only k different meals.

Alas, the students are known to be picky eaters. (Which is a well established Czech tradition.) If they get the same meal for l days consecutively, they rebel against the cooks. (defenestration, which is another fine Czech tradition.)

Count the number of menus, which avoid student rebellion.

입력

On the standard input, you will find a single line containing three space-separated integers: n, l, and k. Here n is the number of days (0 ≤ n ≤ 2,000,000,000), l the impatience of the students (the number of repeats of a single meal, which causes the students to rebel, 2 ≤ l ≤ 200), and k is the number of possible meals (1 ≤ k ≤ 100).

출력

The standard output shall contain a single integer: the number of possible menus modulo 4,000,000,009.

제한

예제 입력 1

3 2 3

예제 출력 1

12

힌트

There are exactly 12 menus of the required properties:

1 2 1
1 2 3
1 3 1
1 3 2
2 1 2
2 1 3
2 3 1
2 3 2
3 1 2
3 1 3
3 2 1

출처

Olympiad > Central European Olympiad in Informatics > CEOI 2015 > Practice 1번

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

출처

대학교 대회

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

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