Answer is right but showing wrong answer

question=https://hack.codingblocks.com/contests/c/424/1394
solution=https://ide.codingblocks.com/#/s/15105

there is garbage printing in your output as u have done a[n] don’t do this i have corrected this still ur 2 nd test case is running twice just see that case

Hello Aayush ! actually ur code is not working for this test case
2
4
-1 0 -3 5
I modified ur code here you can check it out
http://ide.codingblocks.com/#/s/15731
I commented out every where in my code so that you will get understand easily

if you will input 2 then there will be garbage for the output of 2nd test case.
for the test case u showed the answer is right for mine as well as yours.
the only difference is the sequence of output

please show the correction