Help me debug SIGKILL error.

I have been trying to solve SPOJ.com - Problem SUMFOUR . But I am getting SIGKILL error in the 10th test case (which I presume is the largest input case). If possible, please help me debugging it. I have used a simple O(n^2(log2(n))) algorithm.

Here goes the code: WWEjN8 - Online C++ Compiler & Debugging Tool - Ideone.com