knapsack problem using greedy method