use std::io::{self, BufReader, BufWriter, Read, Write}; fn main() { let stdin = io::stdin(); let mut stdin = BufReader::new(stdin.lock()); let stdout = io::stdout(); let mut stdout = BufWriter::new(stdout.lock()); let mut buf = String::new(); stdin.read_to_string(&mut buf).unwrap(); let mut iter = buf.split_whitespace(); let l: u32 = iter.next().unwrap().parse().unwrap(); let k: u32 = iter.next().unwrap().parse().unwrap(); let result = (l - 1) / (2 * k) * k; writeln!(&mut stdout, "{}", result).unwrap(); }