use proconio::input; fn main() { input! { a:i32, b:i32 } let rem = b % a; if rem == 0 { // 割り切れた場合は最短 let min_step = b / a; println!("{}", min_step); } else { let mut c = 1; loop { let aaa = a * c; let r = b % aaa; if r > 1 { println!("{}", c); break; } c += 1; } } }