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