joyfest-and-joyful-cake

The JoyFest at SVNIT comes to end. In the closing ceremony, a joyful cake is distributed among all visitors and volunteers. There is a huge cake, but the crowd is even larger in number. Janit, coordinator of JoyFest cuts the cake.

Janit knows how many people are there and he wishes to give only one piece of cake to each person. Janit has his own way of maximizing number of pieces. For each cut, he tries to make maximum possible smaller pieces after that cut. The cake is circular and each cut follows a straight line that passes through the circle twice. There will be no half-cuts or semi-cuts. (Picture demonstrating what is cake cut mean as described in statement.)

He wants you to help in determining what is the minimum number of cuts he should make so that every person gets at least one smaller part of the cake.
(With this kind of distribution, every person will not get same size of cake and he is not bothered of it.)
Input:
First line contains number of test cases T.
T lines follows. Each test case consists of a number N denoting number of persons(min no. of pieces he should make).

Output:
For each test case, print a number denoting number of cuts Janit should make on the cake.

Constraints:
1 ≤ T ≤ 10^6
1 ≤ N ≤ 10^12

Large input files. Use faster i/o methods.

Problem Setter : Vinay Kumar

SAMPLE INPUT
3
3
4
12

SAMPLE OUTPUT
2
2
5

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions: