LQDCANDY - CANDY
John had a chocolate bar with the size of 2^i. At his birthday party, he shared this chocolate bar to his friend. But his friend just wanted to taste a piece of this chocolate bar which had the length of N (1 <= N <= 10^18) so that John had to break this chocolate bar into pieces to get the piece for his friend. Unfortunately, this chocolate bar was so breakable that John just can break it into half each time.
Help him find the smallest length of the chocolate bar that he needs and the minimum times of breaking the chocolate bar to get the piece for his friend.
Input
T - the number of test cases. In each of the next T lines, there is one numbers N
Output
For every test case, print one line the length of the chocolate bar and the minimum number of times to break the bar.
Example
Input: 3
8
5
7 Output: 8 0
8 3
8 3
hide comments
vipin:
2011-08-29 17:39:25
whats the output when the input is 100? Is it "128 5"?
|
|
Konsta Kanellis:
2011-07-21 12:09:45
Be carefull of the way you are reading the input. |
|
黄俊翔:
2011-07-21 08:02:50
when I used long,I got wa
|
|
Abdelrahman Hatem:
2011-07-01 00:18:43
@Todd B
|
|
Santiago Zubieta:
2011-06-21 08:09:43
Hmmm got AC using a cycle to find the i in 2^i... but using log2(bar size) it gives me WA... And I'm even checking afterwards if the result of that log isn't exact, to round it up. Last edit: 2011-06-21 08:10:29 |
|
shinoda:
2011-06-18 00:26:43
success...
|
|
mukesh tiwari:
2011-06-17 14:59:18
after solving this , try https://www.spoj.pl/problems/SILVER/ |
|
Suresh Iyengar:
2011-06-16 10:11:53
Can you explain the test data. Why is the output 8 3 for input N=5.
|
|
bashrc is back:
2011-06-16 03:05:25
The test case data are definitely random.My same code without any modifications has time .01-0.05 s for different submissions. |
|
sudipto das:
2011-06-15 03:40:12
Remember i starts from '0' (for 2^i) |
Added by: | Tmbao |
Date: | 2011-06-07 |
Time limit: | 0.5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | COCI |