import strutils, sequtils let t = stdin.readLine.parseInt for v in newSeqWith(t, stdin.readLine.split.map(parseInt)): echo((v[0] * v[1]) + v[1])