NZEC solution for Cleaning Tables problem - http://www.codechef.com/AUG14/problems/CLETAB