added feature for obtaining total cost from original particular costs of knapsack items