Submit | All submissions | Best solutions | Back to list |
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
|
||||||||
2012-06-21 05:27:47 spock
phew.. logic.. :) |
||||||||
2012-06-14 14:39:22 stranger
I am agreed with Aman Verma. Pls, explain example at least. Hmm, it's not so hard as it may seem at first look Last edit: 2012-06-14 17:13:02 |
||||||||
2012-05-25 10:57:58 Aman Verma
cant get the ques pls put some more test cases and explain a bit pls pls pls |
||||||||
2012-05-15 03:48:04 Pankaj Kumar
easy.... |
||||||||
2012-04-20 11:19:38 LeppyR64
One line at a time, as many times as he wants. |
||||||||
2012-04-20 09:22:16 mohit singh
CAN HE DRAW MORE THAN ONE LINE OR only a single line?? |
||||||||
2012-01-21 14:47:21 rishabh
easy!! |
||||||||
2012-01-09 21:00:43 Spooky
@irakli intended is with a newline... Last edit: 2012-01-09 21:02:00 |
||||||||
2011-12-28 17:59:05 Ikhaduri
should i output with a newline or on the same line??? |
||||||||
2011-09-17 17:32:31 Mukul Agrawal
you are indirectly asking "can anyone tell me how to solve this problem?"..think!!......:) |