t=int(input('pleasee netr number of cases')) k=[] for i in range(t): x=int(input()) y=int(input()) while(x%y!=0): x=x+1 k.append(x) for i in range(len(k)): print(k[i])