Problem 3695 · Hard

Maximize Alternating Sum Using Swaps

Connected swap groups can be rearranged freely, so put the largest values on the even positions.

Open the interactive visualisation