“N” people are standing in a line, we name them as a0, a1, ... aN.

The age of any subset of people is defined to be the sum of its individuals.

we want to kill the oldest subset of these N people in a way that for each pair of killed people “ai” and “aj”, the distance is between “p” and “q”.

0< p <= abs(I — j) <= q

p and q are positive numbers. N < 20,000

———-

The above is a problem I came to when designing time series in a charting library. I have converted the original problem into a more readable codeforces style. This will be calculated in each WebGL animation frame, It needs to be fast.

What a rollercoaster ride!

Guys, don't help this serial killer

I know alot of countries' populations are getting older but this is just excessive.

a0,a1,.....aN means there are N+1 people not N people.

Is this money heist?