this gives the correct answers for the ratio greedy as well as the difference greedy