Problem 3867 · Medium

Sum of GCD of Formed Pairs

Build prefix GCDs against the running maximum, sort them, and pair the two ends inward.

Open the interactive visualisation