Thanks for such an editorial.
Actually, this editorial explains things better than codechef YouTube videos.
I learnt something new.
Thanks.
There are 8 elements in the array and n=7. Hence, the test case is invalid.
yeah that’s probably because you entered n as 7 so it stops taking the values before your last 25 of the array
When you use LONG_LONG_MIN, it results in an overflow and you end up getting very large values and the line you have mentioned is not necessary, even without it you will get AC.
Please if you can tell what was the point for adding below line of code
dp[i][j] = max(dp[i][j], -inf); ?
True when codeforces can do this having lot many contestants taking part in it why cant codechef do it.

I’m trying to find error in this. my solution gives RE in few , AC in few and TLE(i know and its not problem) the problem is why it is giving RE. Can you please help. I’ve added comments in my code to help you understand better. I’ll improve the time complexity but the issue is RE.
Hey I just took your code and instaed of this ll l = f(i, j, 1); // start from current index i;
i wrote this which you told ll l = a[i]*j+f(i+1, j, 1) but it’s not getting accepted anymore , can you please tell why
No Point
Same here bro. I am also solving it in same complexity but using recursive dp. Authors should increase TL.