Clash of KIngs IITK1P01 wa plz help

http://www.codechef.com/problems/IITK1P01 ->problem statement
sol : http://www.codechef.com/status/IITK1P01,archit_jain08

//