greedy.c