greedyknapsack creates correct output