Company: Algo University SDE 2nd round_21april
Difficulty: medium
You are provided with a fixed number of red and blue blocks for the construction of a colorful monument. The construction must obey the following rules: The colorful monument consists of some number of floors. If the monument has n floors, then the first floor contains n blocks, the second floor contains n - 1 blocks, the third floor contains n - 2 blocks, and so on, until the last floor contains exactly one block. Each floor must contain blocks of only one color: either all red blocks or all blue blocks. Let h be the maximum possible number of floors in a monument that can be built using the available red and blue blocks. Your task is to determine how many different colorful monuments with exactly h floors can be built. Unused blocks may remain after constructing the monument. Two colorful monuments are considered different if there exists at least one floor that is made of red blocks in one monument and blue blocks in the other. Since the answer may be too large, output the number of