from sys import stdin n, *indata = map(int, stdin.read().split()) offset = 0 for i in range(n): s, t = indata[offset + 2*i],indata[offset + 2*i+1] ans = (s+1) * t print("{}".format(ans))