#include #include #include #include #include using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long val1 = A * (N - 1) - B * N; // all -1 long long val2 = -A * (N - 1) - B * (N % 2); // -1, +1, -1, +1, ... cout << min(val1, val2) << endl; return 0; }