Problem 3944 · Medium

Minimum Operations to Make Array Modulo Alternating II

Price each residue for the even and odd positions, then choose two different residues that together cost the least.

Open the interactive visualisation