Pls help me find where i go wrong

here is my code for the problem with code RECNDNOS
https://www.codechef.com/viewsolution/33636247