Accepted
代码
#include <bits/stdc++.h>
using namespace std;
inline int read()
{
char ch=getchar();
int x=0;
while(!isdigit(ch))
ch=getchar();
while(isdigit(ch))
{
x=x*10+ch-'0';
ch=getchar();
}
return x;
}
int n;
int main()
{
int x,y,cnt;
n=read();
while(n--)
{
x=read(),y=read();
cnt=0;
while(x!=y)
{
if(x>y) x>>=1;
else y>>=1;
cnt++;
}
printf("%d\n",cnt);
}
}