from time import sleep from sys import stdin pin=stdin.readline t=int(pin()) for _ in[0]*t: a,b=map(int,pin().split()) now=0 ans=0 for _ in range(b): now+=a ans+=1 print(now+ans) sleep(0.1)