Dynamic Programming

www.spoj.com/problems/MINVEST