fn main() { let mut nab = String::new(); std::io::stdin().read_line(&mut nab).ok(); let nab: Vec = nab.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nab[0]; let a = nab[1]; let b = nab[2]; let mut result = (n-1) * a - n * b; result = result.min(-a * (n-1) - n % 2 * b); if n % 2 == 0 { result = result.min(-a * (n-3) - b * 2); } println!("{}", result); }