n = int(input()) while n > 0: x, y = input().split(" ") x = int(x) y = int(y) if x % y == 0: print(x) else: k = x + (y - (x % y)) print(k) n -= 1