http://www.codechef.com/MAY13/problems/NAME2