T = int(input()) cases = [list(map(int, input().split())) for _ in range(T)] for a, b in cases: print((a+1) * b)