knapsack problem: meet in the middle approach