Problem 3937 · Medium

Minimum Operations to Make Array Modulo Alternating I

Price every residue class separately for the even and odd positions, then combine the cheapest pair of distinct residues.

Open the interactive visualisation