use proconio::input; fn main() { input! { (a, b): (i64, i64), } let abs_b = b.abs(); let ans = ((a % abs_b) + abs_b) % abs_b; println!("{}", ans); }