from sys import stdin def main(): input = lambda: stdin.readline()[:-1] T = int(input()) for _ in [0] * T: A, B = map(int, input().split()) ans = A * B + B print(ans) main()