T = int(input()) for _ in range(T): A = list(map(int, input().split(' '))) K = A[0] * A[1] + A[1] print(K)