Delhi's odd even problem

I am try to solve this question in fundamental problems. According to given problem statement, my output against custom input is correct too still test cases doesn’t pass.

Can anyone please help me find the problem?

Code: https://ide.codingblocks.com/s/36704

https://ide.codingblocks.com/s/39683

You can refer this code.