There are beds numbered from 1 to . Initially, each bed has a single pillow. Alex performs exactly moves. A move can be described as picking a pillow from Bed and placing it on Bed such that . Help Alex to find the number of possible final states of the beds. Two states are considered different if at least one bed has a different number of pillows. Since the answer could be large, compute the answer modulo .
Input Format:
Output format:
For each test case, compute the number of possible final states after performing the operations described above modulo .
Constraints:
For testcase 1: and . The possible final states are (3,0,0), (0,1,2), (0,2,1), (0,3,0), (1,0,2), (1,1,1), (1,2,0), (2,0,1), (2,1,0), (0,0,3) Hence, the answer for this case is 10.
For testcase 2: The possible final states is (1,1). If a pillow is moved from Bed 2 to Bed 1 in the first move, then for the second move, our only option is to move a pillow from Bed 1 to Bed 2. Similarly, if we choose to move a pillow from Bed 1 to Bed 2 in the first move, we obtain the same final state.
For testcase 3: The possible final states are (1,1), (1,0), (0,1). Hence, the answer is 3.