t = int(input()) for _ in range(t): a,b = map(int,input().split()) strss = a*b ans = b+strss print(ans)