knapsack problem using greedy method algorithm