RE in COOKMACH

https://www.codechef.com/viewsolution/28570753
Works fine on my ide but when i submit the code i get SIGABRT runtime error

Can someone look into the code and tell why it’s giving that error I can’t figure out what’s wrong