t=int(input()) l=[] exec('a,b=map(int,input().split());l+=[a*b+b];'*t) for i in l:print(i)