« first day (1 day earlier)    last day (15 days later) » 

7:07 AM
@evinda You know exactly how many times the loop would be called. You populate the new list by removing an element from the heap. The new list should have $n$ elements. Therefore, you should be looping $n$ times and removing an element from the heap $n$ times.
Sorry for the delayed response, I've been gone for a while.
 
 
15 hours later…
10:14 PM
@Axoren So is it right like that? pastebin.com/nuiutH2n
 

« first day (1 day earlier)    last day (15 days later) »