Two players $A$ and $B$ are playing a game with array $A$ of $N$ elements in which each player chooses an array interval with maximum sum. The other simultaneously chooses another interval in the same array such that both the chosen intervals follow certain rules:
Two chosen intervals shouldn't have anything between them. That is, they should not be overlapping.
Two intervals chosen shouldn't be too close to each other. There must be at least K index distance between the finish of the first interval and the start of the second interval.
The sum of the values in chosen intervals should be as big as possible. Or we can say both chosen intervals sum should be as large as possible.
Example:
Let $N=8$, $K=3$, and $A=\{5, 5, -1, -2, 3, -1, 2, -2\}$. It is optimal to choose $[1, 2]$ and $[7, 7]$ intervals. That is the only optimal choice that we can make.
And total sum if $10$(from first interval) $+ 2$(from second interval) $= 12$.