Spoj Problem Pocket Money (Code : LISA)

Algorithm - DP (Similar to Matrix Chain Multiplication)
Find the best parenthesization of the given expression.
Problem Link:
http://www.spoj.com/problems/LISA/