Computationally Efficient Changepoint Detection for a Range of Penalties