getting SIGABRT error please help

I have commented my algorithm in my code CodeChef: Practical coding for everyone i am getting SIGABRT error cant find the error please help.I have no idea about illegal instrctusion in c language can u plz put a example of it.

link for qstn

Thank you