HDU 1244 - Max Sum Plus Plus Plus
Problem : Given a sequence. Find k non-interval consequtive subsequence s.t. the length of each consequtive subsequence is l1, l2, ..., lk in order and the sum of the chosen subsequence is maximum.
Solution : Let f[i][j] means first i subsequence is chosen at the prefix of original string length j, and the maximum sum. Thus f[i][j]=max(f[i-1][j-li]+sum(S[j-li+1..j]), f[i][j-1]).