Make array alternating: even indices have even values, odd indices have odd values. Minimum changes. Split into two problems: even indices should be even, odd indices should be odd.
Rounding to nearest valid value. Cost: for even index with value , cost to make even is . For odd index, cost to make odd is . This is a simpler structure. Slope Trick applies if we generalize to 'make non-decreasing with parity constraints'.