Tells me the required Corrections

could u please tell me a few errors that I might have made in the given program due to which my code fails in the first test case? the link for the code is: https://ide.codingblocks.com/s/423706

For input

3
3 2 1

Output should be

-1 3 3

Because array is circular,debug for this