Knapsack. Optimal Binary Search Tree