using System; using System.Collections.Generic; using System.Linq; class Program { static void Main() { var cnt = int.Parse(Console.ReadLine()); for (int i = 0; i < cnt; i++) { var x = Console.ReadLine().Split().Select(int.Parse).ToArray(); Console.WriteLine(x[1] + (x[0] * x[1])); } } }