Solution for Code Chef Problem 'HOLES' (http://www.codechef.com/problems/HOLES)