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