algo: knapsack iterative version