implementation of knapsack problem using greedy algorithm in c