#C7208. Maximum Staircase Height
Maximum Staircase Height
Maximum Staircase Height
Given an integer B which represents the number of blocks available, construct the highest possible staircase. In the staircase, the first row requires 1 block, the second row requires 2 blocks, the third row requires 3 blocks, and so on. The problem is to determine the maximum height h such that the sum of the first h natural numbers, (\frac{h(h+1)}{2}), does not exceed B.
For example, if B = 6, the staircase can have at most 3 rows (since 1 + 2 + 3 = 6).
inputFormat
The input consists of a single integer B which denotes the number of blocks available.
outputFormat
Output a single integer which is the maximum height of the staircase that can be built with B blocks.## sample
1
1
</p>