def main(): for i in range(int(input())): a, b = map(int, input().split()) print((a+1)*b) if __name__ == '__main__': main()