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