import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline import sys T=int(input()) for tests in range(T): ANS=0 X,Y=map(int,input().split()) if X