WA in PSHOT

Hey guys,
Can someone please help me in figuring out the bug in my code: https://www.codechef.com/viewsolution/34414135
Thanks.