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
THESEUS:
2015-08-24 17:49:58
Unfair for JAVA, getting TLE's, used bits, bufferedReader,printWriter |
|
SangKuan:
2015-07-18 13:07:36
thanks @aman verma |
|
---@@@----:
2015-06-03 06:37:01
remember 'i' can be =0..
|
|
[Mayank Pratap]:
2015-05-25 12:34:27
Think Simple not much need of bit programming here :) |
|
nagendra patod:
2014-10-26 16:38:20
got ac in 0.01
|
|
ashok choudhary:
2014-08-18 19:23:16
after 4 tle, AC in just 0.02
|
|
robin:
2014-07-20 19:43:05
my 50th..
|
|
kelaseek:
2014-06-15 13:10:09
hint:don't do anything |
|
GreyHaze:
2014-04-06 21:57:00
Incredibly unfair for java... None of the normal bit operations will work.. they all time out... even after using fast i/o... Last edit: 2014-04-06 21:57:24 |
|
sehwag:
2013-10-29 20:37:37
easy one... |
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 |