WA in CHEFCCYL

https://www.codechef.com/viewsolution/28551416
My solution