t=int(input()) A=[] B=[] for i in range(t): a,b=map(int,input().split()) A.append(a) B.append(b) for i in range(t): print((A[i]+1)*B[i])