#include #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define FORR(i,a,b) for (int i=(a);i>=(b);i--) #define pb push_back using namespace std; typedef long long ll; typedef pair pii; typedef vector vi; typedef set si; const int inf = 1e9; const int mod = 1e9+7; ll pow(ll a, ll n){ ll p = 1; while(n > 0){ if(n & 1) p = p * a; a = a * a; n >>= 1; } return p; } int n, c, v; main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n >> c >> v; int ans = inf; FOR(i, 1, 20){ int p = 2, pr = 1, ps = 0; while(pow(p, i) < n) p++; FOR(j, 0, i){ if(pr * pow(p-1, i-j) < n){ ps += p; pr *= p; }else{ ps += p-1; pr *= p-1; } } int co = i * c + (ps - i) * v; ans = min(ans, co); } cout << ans << endl; }