Getting SIGABRT error in the geiven code.

When I am running the given code in my local computer, it is working perfectly fine, but when I am running it on codechef compiler, it is showing SIGABRT error.

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

Please help.