fn read() -> Vec where ::Err: std::fmt::Debug, { let mut b = String::new(); std::io::stdin().read_line(&mut b).unwrap(); b.split_whitespace() .map(|x| x.trim().parse::().unwrap()) .collect() } fn gcd(x: u64, y: u64) -> u64 { let (x, y) = if x < y { (x, y) } else { (y, x) }; if x == 0 { return y; } return gcd(x, y % x); } fn main() { let iv = read::(); let a = iv[0]; let b = iv[1]; let ag = gcd(a + b, a); let bg = gcd(a + b, b); println!("{}", ag / gcd(ag, bg) * bg); }