func main() var n: int :: cui@inputInt() var c: int :: cui@inputInt() var v: int :: cui@inputInt() var ans: int :: lib@intMax for i(1, n) var cost: int :: c + (i - 1) * v var num: int :: i while(num < n) do num :* 2 do cost :+ c + v end while do ans :: [ans, cost].min() end for do cui@print("\{ans}\n") end func