t = int(input()) for i in range (t): x,y = map(int,input().split()) value = x+y - (x % y) print(value)