IIITA1  Playing With Bits
Maaz and Aradhya are quite brilliant students of Mathematics and Programming respectively. One day, their Mathematics Professor Mr. K.P. Singh asked them to solve a Mathematics problem.
Given two number A and B, find the minimum number of bits required to convert binary representation of A into binary representation of B.
Maaz promised Mr. K.P. Singh that he will be the first one to solve the problem but Aradhya decided to do it before him. He turns to you for help. Will you be able to help him?
Input
Input consists of t (number of test cases), then t lines follows, each containing two integers a and b (1 <= a,b <= 2^31)
Output
A single line containing the minimum number of bits required to convert binary representation of A into binary representation of B.
Example
Input: 2
14 31
56 68
Output:
2
5
Time Limit is kept very strict. Any naive algorithm will never be accepted.
hide comments
victor gomez:
20130515 07:56:15
can some one doa tutorial, i need to solve this problem for a final exam; //plis should be in C++ Last edit: 20130515 07:57:11 

:D:
20120826 21:15:52
Please don't set up such ridiculous times in the main problem set.


StupidGuy:
20120826 16:31:09
So, finally tutorial it is... 

Shubham:
20120826 16:31:09
@better late than never,problemID 7534417 and 7534410 are exactly the same but one got accepted and other one showed TLE. And by exact I mean exact.look into this please.


mehmetin:
20120826 16:31:09
As pointed out by S#!THAPPEN$, the judge can give TLE for no reason. It happens with other problems too. It must have something to do with the system. 

Francky:
20120826 16:31:09
Solution had been rejudged and I loose my 0.07s :(


Secret:
20120826 16:31:09
it should be moved to tutorial . 

Alex Anderson:
20120826 16:31:09
This should be tutorial or challenge. 

Aradhya:
20120826 16:31:09
:D check my submissions in id's 7532238 and 7532240.. not even a single character change :D one AC and one TLE.. lol on spoj machines 

Aradhya:
20120826 16:31:09
my c++ code which took 0.09 sec ,, got TLE in PYTH o.O.. reset the time limit snehasish 
Added by:  Better late than never !!! 
Date:  20120825 
Time limit:  0.100s 
Source limit:  500B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 
Resource:  Navneet Sir 