greedy algorithms: knapsack problem