T = int(input()) for i in range(T): A, B = map(int, input().strip().split(' ')) print((A + 1) * B)