Q=int(input()) for i in range(Q): D,K=map(int,input().split()) ans=[] for i in range(D): for j in range(4): ans.append((i**2+(D-i)**2,(i,(D-i)))) if D==0: ans.append((0,(0,0))) ans.sort() if len(ans)