Solve UVa 10304 - Optimal Binary Search Tree.