Giving correct output but not passing test cases


please let me know why it is not passing test cases

Dry run your code for the test case with input:
4
2
1 1
2
1 1
3
1 2 3
3
4 5 6
4
1 2 3 4
0
2
1 1
2
-1 2
Desired output is:
1 1 1 1
1 2 3 4 5 6
1 2 3 4
-1 1 1 2
output given by your code: 1 1 1 1 1 2 3 1 2 3 4 4 1 1 5 6 -1 2

i have made some changes still not working please check and edit my code so that i could understand where the problem is

I have modified your code check https://ide.codingblocks.com/s/250028
thanks!

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.