#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 using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) int dp[20][1000]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; int c,v; cin>>n>>c>>v; rep(i, 1000)dp[0][i] = i+1; rep(i,20-1)rep(j,1000)if(dp[i][j]){ if (dp[i][j] >= n)continue; int len = dp[i][j]; for (int k=1;k= n)break; dp[i + 1][j + k] = max(dp[i+1][j+k], dp[i][j] + len * k); } } int ans=INF; rep(i,20)rep(j,1000){ if (dp[i][j] >= n){ ans = min(ans, c*i+v*j); } } cout<