Https://www.codechef.com/viewsolution/37719800

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

My code is simple and easy. I can’t understand what is problem with it.
Also, when I test run any code with run option, it invariantly shows “nzec” error. When I submit same code, it passes all cases and I get 100% points. Also , I recently got my 2nd star. Did I get it by solving practice question???