Add penalty per region. Penalized DP: = min cost to partition first levels into any number of regions, with penalty. Transition: . The is the per-region penalty.
Now you have states (one per position). If can be computed in with preprocessing, total time is per binary search iteration, or overall.