T=int(input()) for _ in range(T): x,y=map(int,input().split()) #(x,y)=b -> unit #(x,y)=w -> disjoint bit=bin(x)[2:][::-1] if bit[y]=="1": while y+1