Problem description.
Liza wants to share her  pizza among n friends, What are the minimum number of straight knife strokes required to cut the pizza into n pieces?
 

Input
The first line contains number of test cases T.
The next T lines contain the input numbers N, the numbers of pieces required.


Output
For each test case, output in a new line, the minimum number of straight knife strokes(integer), required for the test case.


Constraints

1 ≤ t ≤ 1000
1 ≤ n ≤ 1000

 

Example
Input:
3
4
5
6
Output:
2
3
3
from math import ceil
from math import sqrt
t=input()
for _ in xrange(t):
    n=input()
    if n==1:
        print "0"
    else:
        ans=ceil((-1+sqrt(1+4*2*(n-1)))/2)
        print int(ans)