Expand the problem DREAM in July12

http://www.codechef.com/JULY12/problems/DREAM
I have invent an idea: If we expand the problem to delete M smallest numbers, so how we do it? I think this problem should use heap and gready ?

//