wrong answer in checkmate

i hereby am attaching my code link , i cannot find any test case that unsuits this, can anyone help?
https://www.codechef.com/viewsolution/54870877