func main() var n: int :: cui@inputInt() var c: int :: cui@inputInt() var v: int :: cui@inputInt() var ans: int :: lib@intMax for numCV(1, 20) var costC: int :: (c + v) * numCV - 2 * v var ratio: int :: 2 ^ (numCV - 1) var numV: int :: ((n - 1) / ratio + 1) var costV: int :: v * numV var cost: int :: costC + costV do ans :: [ans, cost].min() end for do cui@print("\{ans}\n") end func