def compute_duration(
    scope: int,
    velocity: list[float],
    change: list[float],
) -> int:
    """Given the simulated velocity and scope change per sprint, compute how many
    sprints are necessary to finish the project.
    """
    max_sprints = len(velocity)
    delta = 0.0
    for n in range(max_sprints):
        delta += velocity[n] - change[n]
        if scope <= delta:
            return n + 1
    return max_sprints