fn main() { let mut vtp = String::new(); std::io::stdin().read_line(&mut vtp).ok(); let vtp: Vec = vtp.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let v = vtp[0]; let t = vtp[1]; let p = vtp[2]; let mut result = (p + 1) * v; let mut behind: usize = 0; let mut times = (result - 1) / t + if (result - 1) % t > 0 { 1 } else { 0 }; result += times; if (result - 1) % t == 0 { result += 1; } behind = t - (result - 1) % t; while times > 0 && times > behind { times = (times - behind) / t + if (times - behind) % t > 0 { 1 } else { 0 }; if (result - 1) % t == 0 { result += 1; } result += times; behind = t - (result - 1) % t; } println!("{}", result); }