Problem 3312 · Hard

Sorted GCD Pair Queries

Collect the gcd of every index pair, sort the values once, and answer each query by position.

Open the interactive visualisation