Problem 3984 · Medium

Divisible Game

Pick a divisor k and a contiguous slice: multiples of k earn their value, everything else costs it, and the best slice for each k is compared.

Open the interactive visualisation