Why do I get Runtime Error(SIGABRT)?

Problem link: https://www.codechef.com/problems/E1
My solution link: https://www.codechef.com/viewsolution/62458533
I don’t know what could cause this, according to the problem n should be between 4 and 1000, and that shouldn’t be too much memory or at least I don’t think so. I would like to know the cause of the error.