Scanf.scanf "%d %d %d" (fun x y l -> let ll k = (abs k + l - 1) / l in Printf.printf "%d\n" @@ ll x + ll y + match y >= 0, x = 0 with | true, true -> 0 | true, false -> 1 | false, _ -> 2 )