Problem 3867 · Medium
Build prefix GCDs against the running maximum, sort them, and pair the two ends inward.
Open the interactive visualisation