How to solve SRM 169 topcoder problem fairworkload ?

link of problem is TopCoder Statistics - Problem Statement ?

In the bottom, they explain how to solve this problem.