adding knapsack problem