Can anyone help me with Cleaning Tables(CLETAB) august challenge question using heap

In Cleaning Tables august 14 editorial,i understood the logic but i could not understand how to implement it.I have few questions.

  1. In authors solution why do we take Mamimum Customer Id = 1600? ,whereas in constraints it is given to be less than 400. what is the complexity of authors solution ? it seems to me it should be m^2.

  2. How to implement it with the heap.(I know how to insert and delete from a heap)

See https://github.com/nastra/hackerrank/blob/master/src/main/java/com/nastra/codechef/august/CleaningTables.java for a solution using a heap.