t = int(input()) for _ in range(t): a, b = map(int, input().strip().split()) print((a+1)*b)