Hello codeforces, I am not able to understand the solution of this problem. Problem link is [http://mirror.codeforces.com/contest/479/problem/E]. Solution is not very clear. In solution it is mentioned that dp[i][j] can be calculated in O(1) using famous technique called "partial sums". I googled it but I could not find anything. Please help me. Thanks in advance.