def solve(): A,B = map(int,input().split()) print(A * B + B) T = int(input()) for _ in range(T): solve()