The International Space Engineering Consortium is designing a modular space station with an innovative nested docking bay system. The station's chief architect requires an analysis tool to determine all valid docking bay configurations.
In this system, docking bays can be nested within other docking bays, creating complex hierarchical structures. Each valid configuration must follow strict safety protocols:
Let be the set of all valid docking bay configurations. The length of a configuration is the total number of docking operations (entries and exits) required. The nesting depth of configuration is defined as follows:
If is empty, then D(E) = 0
If E = (E_1)E_2, where E_1 and E_2 are valid configurations, then D(E) = \max(D(E_1) + 1, D(E_2))
Each pair of parentheses represents an entry and exit from a docking bay level.
For example, the configuration has length ( pairs of entry/exit operations) and nesting depth (maximum of nested levels).
The engineering team needs to determine: for a given length (number of docking operations) and required nesting depth (exactly levels deep), how many distinct valid configurations are there?
Constraints:
Nesting depth satisfies 1 \le d \le 200
Length satisfies 2 \le n \le 300 (representing pairs of entry/exit)
The maximum nesting depth in any configuration must be exactly
Each line contains two integers and , where is the total number of docking operations (must be even), and is the required nesting depth. The input may contain empty lines, which should be ignored.
For each test case, print on a separate line the number of valid docking bay configurations of length and nesting depth exactly .
Example 1