**Problem Description**

But what’s the minimum times he must cut?

For example:

N = 7, Frog cut it twice. The 3 parts each weighs 1, 2, 4.

Then 1 = 1 , 2 = 2 , 3 = 1 + 2 , 4 = 4 , 5 = 4 + 1, 6 = 2 + 4,7 = 1 + 2 + 4.We can measure things whose weight ranges from 1 to 7.

**Input**

The first line of the input contains an integer T(T<=100) ,indicating the number of cases.

The following T lines each has a positive integer n(n <= 10^6), indicating the weight weighs.

**Output**

For each case, you should output the minimum times Frog should cut the gold.

**Sample Input**

3 1 2 7

**Sample Output**

0 1 2