#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define eps 0.00000001 #define LONG_INF 10000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) long long dp[100000] = {}; int main() { long long n, c, v; cin >> n >> c >> v; long long ans = 10000000000000; for (int i = 2;i <= n*2;++i) { dp[i] = 1000000000000; map hoge; for (int j = 1;j <= sqrt(n);++j) { if (i%j == 0) { hoge[j] = true; if(j != 1) hoge[i / j] = true; } } for (auto q = hoge.begin();q != hoge.end();++q) { int wow = q->first; dp[i] = min(dp[i], dp[wow] + c + ((i-wow) / wow)*v); } if (i >= n) ans = min(ans, dp[i]); } cout << ans << endl; return 0; }