it=int(input()) for i in range(it): x,y=map(int,input().split()) if x%y==0: print(x) else: print((x+y)-(x%y))