use proconio::input; fn main(){ input!{ A: i64, B: i64, N: i64, M: i64, } if A>B{ println!("{}",B+(A-B)/(N+1)); } else{ println!("{}",A+(B-A)/(M+1)); } }