Problem 1478 · Hard
Each mailbox serves a contiguous run of houses at their median, and a layered DP chooses where the runs split.
Open the interactive visualisation