http://www.codechef.com/APRIL14/problems/ANUCBC/