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 x + ll y | true, false -> ll x + ll y + 1 | false, true -> ll x + ll y + 2 | false, false -> ll x + ll y + 2 )