t = input() for _ in range(t): a, b = [int(x) for x in input().split()] print(a * b + b)