#K84012. Maximum Shelves Challenge

    ID: 36325 Type: Default 1000ms 256MiB

Maximum Shelves Challenge

Maximum Shelves Challenge

Given an integer \(N\), determine the maximum number of shelves that can be filled such that the books on each shelf form an increasing sequence. Specifically, the first shelf requires 1 book, the second shelf 2 books, and so on. Formally, the goal is to find the greatest integer \(k\) satisfying \(\frac{k(k+1)}{2} \le N\). Process each test case independently.

inputFormat

The first line of input contains an integer \(T\) representing the number of test cases. Each of the following \(T\) lines contains a single integer \(N\), which is the total number of books available.

outputFormat

For each test case, output a single line containing the maximum number of shelves that can be filled.

## sample
4
6
10
15
21
3

4 5 6

</p>