#include #include #include #include #include #include #include #include #include #include #include #include #define PI 3.14159265358979323846 #define mod 1000000007 #define pow9 1000000000 #define INF (1 << 30) using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; long long ans1, ans2; long long ans3 = INF; if (n % 2 == 0) { ans1 = a * (-(n - 1)); ans3 = a *(-(n - 3)) - 2 * b; } else { ans1 = a * (-(n - 1)) - b; } ans2 = a * (n - 1) - b * n; cout << min(ans1,min( ans2, ans3)) << endl; }