P24966 [AtCoder] [ARC039B] Takahashi Kindergarten
普及+
题目描述

Problem Description

Takahashi is a kindergarten teacher. He decided to distribute exactly $ K $ candies to $ N $ children.

Here, the overall happiness is defined as the product of the number of candies each child receives.

Takahashi wants to maximize the overall happiness when distributing candies to $ N $ children. Count how many ways there are to distribute the candies to maximize the overall happiness. Since the answer can be large, output the answer modulo $ 1,000,000,007 (10^9+7) $.

The distribution method is distinguished if the number of candies received by any child is different. Children are distinguished, but candies are not. Also, note that if any child receives no candies at all, the overall happiness will be $ 0 $ according to the definition.

Input Format

The input is given from the standard input in the following format:

$ N $ $ K $

  • The first line contains two integers $N\ (1\ ≦\ N\ ≦\ 100)$ and $K\ (1\ ≦K\ ≦\ 500)$ representing the number of children and the number of candies, separated by a space.

Output Format

Output the result to the standard output in the following format:

The first line should contain the answer modulo $ 1,000,000,007 $.

Do not forget the newline at the end of the output.

Sample Input and Output

Sample Input #1

4 10

Sample Output #1

6

Sample Input #2

100 450

Sample Output #2

538992043

Sample Input #3

5 2

Sample Output #3

15

Notes/Hints

Partial Points

This problem has partial points.

  • For $ 80 $ points, in addition to the constraints in the problem statement, $ N≦K $ is satisfied.
  • There are no additional constraints for the remaining $ 20 $ points.

Sample Explanation 1

Among the $ 4 $ children, if $ 2 $ children receive $ 3 $ candies each and the remaining $ 2 $ children receive $ 2 $ candies each, the overall happiness is $ 3×3×2×2=36 $, which is also the maximum value. Such a distribution method exists in $ 6 $ ways, considering the permutations of the distribution $ (3,3,2,2) $, $ (3,2,3,2) $, $ (3,2,2,3) $, $ (2,3,3,2) $, $ (2,3,2,3) $, $ (2,2,3,3) $.

Sample Explanation 2

Remember that the output should be the remainder of the original answer divided by $ 1,000,000,007 $.

Sample Explanation 3

No matter how the candies are distributed, the overall happiness will be $ 0 $, so any distribution is acceptable.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4 10
样例输出
6