Help me in debugging this code

I have an issue related with my code, → CODE .
According to the “debug” option provided by the codechef, my code is running fine on the individual testcases but gives WA when tested on whole test file.
It says possible reason could be ‘nextline’ after testcase but this isn’t the case.
Please help me realize what’s going wrong here.

Hi @black_cap_01
Test cases that are falling back here:
When N=1 {1} ;
When N = 2 {1,1}