Update greedy.cpp