Test cases failing in Closest to The Origin

My code is compiling correctly, also the code is working on my local machine

The code also get successfully accepted on leetecode - https://leetcode.com/submissions/detail/481191368/

But it is failing test-cases when submitted to CodingBlocks, do I need to modify my code further ?

you have to print the ans in sorted form
have you sort your final ans?

Yes, my final answer is in sorted form.

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.