function Main(){ var T = nextInt(); while(hasNext()){ var A = nextInt(); var B = nextInt(); myout(B + A * B); } }