Can anyone help me with this problem http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3215 ?
If N = n * m, an obvious O(N^2 * k) dp solution won't fit in time. Besides, there is no nice and easy-to-notice proprierty like unimodality of some involved calculations, etc. So it's kind of difficult.
Help? ^^