knapsack reconstruct