knapsack dp output bug fixed