def lscan; gets.split.map(&:to_i); end puts gets.to_i.times.map{a,b=lscan;a*b+b}