CHESUB Problem solution explanation

I am just a beginner but have programming experience of more than 1 year. I know dynamic programming and kadane’s algorithm but still I can’t understand how solution of march lunch time problem CHESUB is given. I understood part for k=1 and 2 but in general I don’t understand the dynamic programming equation used for subtask 3. I want someone to please explain me what exactly is “i” and “j” stands for dp[i][j].What do you mean by “first i index of the array” ? Also please can you explain the whole process by taking a small example with k=3. I watched codechef youtube editorial video and I don’t get anything may be due to my poor communication skill or knowledge but I will be greatful if someone can please clear it as I have been trying to understand it.