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