import sys input=sys.stdin.readline import numpy as np T = int(input()) AB = [map(int, input().split()) for _ in range(T)] A, B = [list(i) for i in zip(*AB)] stress_list = [] for i in range(T): print((A[i]+1)*B[i])