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