Help me in solving EQUALISE problem

My issue

help me with the problem

My code

t=int(input())


for i in range(t):
    a,b=map(int,input().split())
    if a==b:
        print("yes")
        break
    elif a<b:
        while a<b:
            if a>b:
                break
            else:
                a=a*2
        if a==b:
            print("yes")
        else:
            print("no")

    else:
        while a>b:
            if b>a:
                break
            else:
                b=b*2
            
        if a==b:
            print("yes")
        else:
            print("no")    

Problem Link: Make A and B equal Practice Coding Problem - CodeChef

break always leaves the innermost loop. So look at your very first break: which loop does it terminate?

Also your while loops are more complicated as necessary: for instance ‘while a>b’
The loop condition gets checked at every round, so why check it again inside the loop (if a>b) ?