Keep getting wrong answer and execution time on submiting looks as the code hasn't executed full

https://www.codechef.com/problems/MINIMAX2 this is the question and this is my code https://www.codechef.com/viewsolution/33105097. Also there is no accepted submission for this problem.