Corner Test Case

for the question: https://www.codechef.com/COOK106B/problems/RECVSEQ , my solution is giving Wrong Answer: https://www.codechef.com/viewsolution/24337197

I cant understand which test cases am I failing

Please help.

Input:

1
4
2 1 4 5

Your Output: 2 1 0 -1
Expected Output: 2 3 4 5