Problem 3927 · Medium

Minimize Array Sum Using Divisible Replacements

Each value can drop to the smallest present value that divides it. Those targets always stay available, so the scan picks them directly.

Open the interactive visualisation