Help me in Finding the corner case!

I’m trying to solve TREEMIN problem ( TREEMIN Problem - CodeChef ) on codechef. But I’m stuck in a corner case. Can someone help me?

My Submission - CodeChef: Practical coding for everyone