n = int(input()) for i in range(n): a,b = map(int,input()) print(a*b+b)