Find optimal packing for knapsack problem.