Problem 3290 · Medium

Maximum Multiplication Score

Pick indices i0 < i1 < i2 < i3 in b to maximize the weighted sum with a, using a prefix DP over how many picks are made.

Open the interactive visualisation