Problem 3012 · Medium

Minimize Length of Array Using Operations

Any non-minimum remainder gives a smaller value that finishes the job; otherwise minimum copies pair up and halve the count.

Open the interactive visualisation