Original DP: = best cost to partition positions to into exactly segments. This is states. Penalized DP: = best (cost + count) to partition positions to into any number of segments.
This is states. The penalized DP is much faster. You compute it for different values until you find the one that produces exactly segments.