Problem 1799 · Hard

Maximize Score After N Operations

Pair all values to maximize the sum of operation-index times pair GCD.

Open the interactive visualisation