Help me in solving CONSPERM problem

My issue

i am not sure why 1,N-1,3,N-3,… works when n is odd can anyone give me a proof?

Problem Link: https://www.codechef.com/problems/CONSPERM