Problem 3671 · Hard

Sum of Beautiful Subsequences

For each element, track how many strictly increasing subsequences end there with each GCD; extending by a larger element updates those GCDs.

Open the interactive visualisation