#K43487. Days to Finish a Book
Days to Finish a Book
Days to Finish a Book
Ami has a unique way of reading a book. On the first day, she reads 1 page, on the second day, 2 pages, on the third day, 3 pages, and so on. Given a book with n pages, determine the minimum number of days required for Ami to finish reading the book. Mathematically, you need to find the smallest positive integer \( k \) such that \( \frac{k(k+1)}{2} \geq n \).
The input consists of multiple test cases. The first line contains an integer T denoting the number of test cases. Each of the following T lines contains a single integer n which represents the number of pages in the book.
inputFormat
The first line of input contains an integer T (1 ≤ T ≤ 105), the number of test cases. Each of the following T lines contains a single integer n (1 ≤ n ≤ 109) indicating the number of pages in the book.
outputFormat
For each test case, output on a new line the minimum number of days required for Ami to finish the book.
## sample3
10
15
21
4
5
6
</p>