#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:
Then Farmer John told Besty that pairs of parentheses were omitted in this expression. Adding these pairs of parentheses to the expression produces one expression scheme.
For example: , , then is one such scheme.
For any two expression schemes, and , they are essentially different if there exists a sequence such that . Otherwise, they are essentially the same.
For example, and are essentially the same schemes.
Now, Farmer John tells Besty the number of terms and the number of pairs of parentheses in the expression (the sequence 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 and 。()。
Output Format
Output a single line containing the number of essentially different expression schemes.
4 1
4
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号