"""ex-vllm-load — percentile. STARTER: the signature and docstring are the contract; fill
in the body.

Nearest-rank percentile: sort the samples, then take the ceil(p/100 * n)-th smallest
(1-indexed, clamped to [1, n]). No interpolation between points — the value returned is
always one of the measured samples, which is the right behaviour when a sample IS a real
request's latency and an interpolated number would not correspond to anything that happened.
"""

from __future__ import annotations

from collections.abc import Sequence


def percentile(samples: Sequence[float], p: float) -> float:
    """The p-th percentile of `samples` (0 <= p <= 100), nearest-rank (see module
    docstring). Raise ValueError if samples is empty, or if p is outside [0, 100]."""
    ...
