CODE INVICTA MAYA'S BLOG QUERY

I have been trying this question but i don’t know for what test cases am I failing.

https://www.codechef.com/problems/CINVIT05

https://www.codechef.com/viewsolution/44135533

Can someone plz help resolve the problem! Thank You