http://www.codechef.com/COOK46/problems/ANUUND