greedy algorithm knapsack problem python