Efficient penalty search for multiple changepoint problems