local mmi, mce = math.min, math.ceil local n, c, v = io.read("*n", "*n", "*n") local t = {} local inf = (c + v) * n for i = 1, n do t[i] = inf end t[1] = 0 for i = 1, n - 1 do local lim = mce(n / i) for j = 2, lim do local dst = mmi(n, i * j) t[dst] = mmi(t[dst], t[i] + c + (j - 1) * v) end end print(t[n])