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