import math def solve(x,y): return math.ceil(x/y)*y T= int(input()) for i in range(T): arr = [int(x) for x in input().split()] print(solve(arr[0],arr[1]))