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