greedy algorithm knapsack problem with example