KQUERY "what's wrong with my code"

what’s wrong with my code
here is my code


unable to find bug.
plz help

Refer this -:

@Robin_rst Robin bhai , your code is difficult to understand for me.
plz tell me how my code work fine.

miss print in quetion last line of quetion is use less confusing and wrong ( test case pass only and only without this line ) -> “if i > j or i,j is greater than n than answer is 0”

Maybe merging is not properly executed.
See this one , its easy to understand.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

@Robin_rst
Robin Sir
This question’s statement is wrong.
it is taken from spoj but not exact.
the test case is same as in spoj.
but question’s statement is different as it pass test case.
it need correction