for _ in range(int(input())): i,s=map(int,input().split()) print(i*s+s)