http://www.spoj.pl/problems/FP/
here is the link. Can anyone please give me the hint only that how greedy approach is following in this question ? It's strange to see how greedy is there in this question. just the hint of this. no code, nothing! thanks.