SIGABRT signal is sent due to many reasons quoting codechef
SIGABRT errors are caused by your program aborting due to a fatal error. In C++, this is normally due to an assert statement in C++ not returning true, but some STL elements can generate this if they try to store too much memory.
In your case it seems to be use of excessive memory
mot = new long long [k];
sat = new long long [k];
long long *sum = new long long[sq];
Note that the value of k can be as large as 20000 so declaring a array of size k will be fine but your sq = k*k
which is of order of 4*10^8 which is causing a out of memory problem memory. And your algorithm is also not good enough to give AC within time limit.
Codechef has its own forum to ask such questions, and preferable ways to solve this problem has already been discussed there