아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Boring Solitaire

시간 제한1초메모리 제한1024 MB

요약
값 1부터 V까지 각각 S개의 무늬로 이루어진 덱 배열 중에서, 최적으로 두었을 때 더미가 K개 이하가 되는 배열의 수를 1e9+7로 나눈 나머지를 구한다.
난이도

보통10점 중 7점

유형
동적 계획법, 조합론
정답자
아직 제출이 없습니다

문제

During quarantine, Stacking-Knightro (SK) made a new card game. SK respects social distancing and, since SK didn’t have other people around, the game is a type of solitaire. SK will shuffle a deck of cards. Then, at every step, SK takes the card at the top of the deck. When taking the card, SK will place the card on top of one of the existing piles of cards or will make a new pile with this card as the top. SK can only place a card on top of a pile if the value of the card is not less than the card at the top of the pile. The goal of the game is to minimize the number of piles when the deck is empty.

Stacking-Knightro started getting pretty good “score” before too long, so the game became pretty boring once SK figured out the “trick”. SK wants to know how many different starting card arrangements will end up with at most K piles if the game is played optimally at each step, i.e., each card is placed such that it will result in the best outcome.

We have a deck of cards with values 1 through V and a number of suits S, i.e., there are “(V × S)!” arrangements of the cards in the deck (note that “!” refers to the factorial of an integer). Using the game description above and a desired maximum of K piles, you are to determine how many different starting card orders will end up with at most K piles. Since this value can be large, print the output mod 1,000,000,007.

입력

There is only one input line; it contains three integers: V (1 ≤ V ≤ 100), representing the number of card values (values are 1 through V), S (1 ≤ S ≤ 10,000), representing the number of suits, and K (1 ≤ K ≤ V ≤ 100), representing the maximum number of piles allowed.

출력

Print how many different starting card orders will end up with at most K piles.

힌트

Explanation of the first Sample Input/Output:

There are two card values, two suites, and one pile. There are four card arrangements to win the solitaire:

  1. 1s1 1s2 2s1 2s2
  2. 1s1 1s2 2s2 2s1
  3. 1s2 1s1 2s1 2s2
  4. 1s2 1s1 2s2 2s1

예제3

  1. 예제 1

    입력
    2 2 1
    
    예상 출력
    4
    
  2. 예제 2

    입력
    4 3 3
    
    예상 출력
    763937568
    
  3. 예제 3

    입력
    3 1 3
    
    예상 출력
    6