const INF: usize = 1usize << 60; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut cv = String::new(); std::io::stdin().read_line(&mut cv).ok(); let cv: Vec = cv.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let c = cv[0]; let v = cv[1]; let mut costs = vec![INF; n+1]; costs[1] = 0; for i in 1..n { for j in 1.. { let idx = (i + i * j).min(n); costs[idx] = costs[idx].min(costs[i] + c + j * v); if idx == n { break; } } } println!("{}", costs[n]); }