My code is failing test cases .But it is giving correct output

My code URL is :-https://ide.codingblocks.com/s/644228

Plz correct my code.

hi @chhabrarishi2001_264ecb7697e8af2a
according to ques, u will have to first take the input of number of test cases… then take the input…
I have corrected ur code -->


its working fine and passing all test cases…

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.