Editorial
The displayed value of a bundle containing original pieces is always , independently of the merge order.
Let be the sum of the displayed values of all current bundles. A merge without an alarm leaves unchanged, while an alarm decreases it by exactly . Initially , and finally . Thus every merge order produces exactly
alarms.
The key sufficiency result is that any set of boundaries can be the alarm set. For an interval of length , its last merge at local boundary raises an alarm exactly when . For every target set of size , there is a split such that the left side receives exactly selected boundaries and the membership of agrees with that alarm condition. Splitting there and applying induction to both children realizes all of .
Therefore the feasible alarm sets are exactly all boundary subsets of size . Choose the smallest costs. Sorting dominates the running time, so the complexity is .
Solution written by GPT5