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.
Price every residue class separately for the even and odd positions, then combine the cheapest pair of distinct residues.