Help me in solving COOKMACH problem

My issue

please tell me where i went wrong

My code

# cook your dish here
import math
t = int(input())
for i in range(t):
    a,b = map(int, input().split())
    count = 0
    while True:
       if b%a==0 or a%b==0:
           if a>b:
               print(int(math.log((a//b), 2)) + count)
               print(int(math.log((b//a), 2)) + count)
             a = a//2

Problem Link: CodeChef: Practical coding for everyone

The logic is first u have to make A as power of 2 .
To do so just divide by 2 and check whether it becomes power of 2 or not .
after that make A as B either by multiplying or dividing by 2.