import sequtils, strutils let t = parseInt readLine stdin var l, r, a, b: int for _ in 0.. 0: echo a * r + b else: echo a * l + b