// #define _GLIBCXX_DEBUG #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { // Input int d, a, b; cin >> d >> a >> b; // All Search int cost = INT_MAX; for (int i = 0; i <= d; ++i) { cost = min(cost, i * a + (d - i) * b); } // Output cout << cost << endl; }