ADV04J - Invisible point

Daniel marked a point on a plane with sympathetic ink and he has also drawn a regular n-gon with normal ink. Max can see the n-gon, but can't see the point. Max can draw a line and ask Daniel which side of the line the point is. What is the minimum number of questions Max have to ask to define if the point is inside the n-gon in the worst case?

Input

First line of the input contains number t - the amount of test cases. Each test consists of the single integer n - the amount of sides of the n-gon.

Constraints

1 <= t <= 100
3 <= n <= 1000000

Output

For each test case print a single number - the answer to the question in the statement.

Example

Input:
1
4

Output:
3

Added by:Spooky
Date:2010-11-14
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Advancement Autumn 2010, http://sevolymp.uuuq.com/

hide comments
2013-07-03 06:50:30 Rishabh Dugar
take care of %2==0 & %2==1
2013-05-31 06:52:43 Aman Kumar Sinha
thanks @Atul
2013-05-19 19:02:48 ওয়াসী (Wasi)
Nice problem...
2013-05-19 10:47:50 Ankur
Finally... AC :)
2013-04-06 15:20:07 marwan akkad
marvellous
2013-02-05 11:51:59 Meraj Ahmed
interesting 1
2013-01-14 02:38:00 Santiago Palacio
I can't believe i made such a fuzz of a simple problem... manually making some small test cases will help.
2013-01-09 19:21:56 Aditya Bahuguna
brains at work ;P.....
2012-07-28 09:47:17 sahil
can any one tell me what are the output for 10,20,26,27,29,43,50,10000,11111 ?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.