SPACEARR: HELP : March long challenge

I have submitted this problem of March long 2021.
My approach
First check if the sum is greater then or equals to (n*(n+1))/2 , print second else check the difference between the two, if difference if odd print first and if even print second.
The code fails at one test case. Please help me finding out if there is any logical error in the code.
edit : please check the first if statement, removing it gives the correct answer, i don’t know why, i think it have to be considered.