#K74172. Arranging Coins Pyramid

    ID: 34139 Type: Default 1000ms 256MiB

Arranging Coins Pyramid

Arranging Coins Pyramid

You are given an integer N representing the number of coins (or stones). The task is to arrange these coins into a pyramid shape where each row r contains exactly r coins. A row is considered complete if it contains exactly the required number of coins.

The number of coins needed to form the first r complete rows is given by the triangular number formula:

\(\frac{r(r+1)}{2}\)

Your goal is to determine the maximum number of complete rows that can be built with N coins.

inputFormat

The first line of input contains a single integer T (the number of test cases). Each of the following T lines contains one integer N, representing the number of coins.

outputFormat

For each test case, output a single line with one integer representing the maximum number of complete rows that can be formed.

## sample
2
10
15
4

5

</p>