N = int(input()) result = [] for _ in range(N): a, b = map(int,input().split()) result.append(a*b+b) print(*result, sep='\n')