#P2270. [HNOI2002] 奶牛的运算

[HNOI2002] 奶牛的运算

Description

Recently, the cows on Farmer John's farm have been taking a basic math class. One day, the cow Besty learned addition, subtraction, and how to use parentheses.

To test Besty's learning, Farmer John wrote the following expression:

S=A1A2AnS =A_1-A_2-\ldots-A_n

Then Farmer John told Besty that KK pairs of parentheses were omitted in this expression. Adding these KK pairs of parentheses to the expression produces one expression scheme.

For example: S=A1A2A3A4S=A_1-A_2-A_3-A_4, K=2K = 2, then S=(A1)A2(A3A4)S = (A_1)-A_2 - (A_3- A_4) is one such scheme.

For any two expression schemes, SS' and SS'', they are essentially different if there exists a sequence A1,,AnA_1, \ldots, A_n such that SSS' \ne S''. Otherwise, they are essentially the same.

For example, S=(A1)A2(A3A4)S'=(A_1)-A_2-(A_3-A_4) and S=(A1A2)(A3A4)S''=(A_1-A_2)-(A_3-A_4) are essentially the same schemes.

Now, Farmer John tells Besty the number of terms NN and the number of pairs of parentheses KK in the expression (the sequence AA is variable; we do not need to care about it). He wants to test how many essentially different expression schemes there are.

Input Format

The input contains a single line with two integers NN and KK。(1<N,K<1001<N,K<100)。

Output Format

Output a single line containing the number of essentially different expression schemes.

4 1
4

Hint

Translated by ChatGPT 5