1부터 N까지의 순열을 문장으로 두고 하루 N개의 시간 구간에서 최적으로 읽을 때 정확히 K일이 걸리는 순열의 개수를 1e9+7로 나눈 나머지를 구한다.
어려움8동적 계획법조합론아직 제출이 없습니다시간 제한0.6초메모리 제한256 MBOne day, JOI-kun got a time machine. He decided to go to Japan in the 9th century. He met Kukai, one of the most famous priests in Japan at the moment. The priest wanted to develop the new way of training.
His training is done in the following way:
Kukai wants to read the whole sutra as fast as possible. However, how many days it takes for him to finish depends on the integers on the sentences in the sutra. JOI-kun was asked by Kukai to count the number of possible ways of integers on the sentences that takes Kukai exactly K days to finish reading, if he reads optimally.
Given the number of sentences N and an integer K, calculate the number of possible ways of integers on the sentences that takes Kukai exactly K days to finish reading, if he reads optimally, modulo 1 000 000 007.
Read the following data from the standard input.
Print the number of possible ways of integers on the sentences that takes Kukai exactly K days to finish reading, if he reads optimally, modulo 1 000 000 007.