import sys input = sys.stdin.readline import bisect import copy from heapq import heapify, heappop, heappush def main(): t = int(input()) for _ in range(t): a,b = map(int,input().split()) print(a*b+b) if __name__ == "__main__": main()