Problem 2941 · Medium

Maximum GCD-Sum of a Subarray

Maximize the gcd of a subarray times its sum, over subarrays of at least k numbers. Groups keyed by gcd keep the work small.

Open the interactive visualisation