Help with SEQSEARCH

Hello, needed help in understanding why this approach is not working?

I have two cases-
if a <= b, then the series is strictly increasing and so i just calculate the kth vaue

otherwise, i have k, take away the first three numbers, and then see if its odd or even

//NOW IN MY SERIES, I HAVE TWO AP SERIES
//0 , b , 2b , 3b , 4b… (which is indexes 0,2,4,6…) - SERIES 1
//a , a + b , a + 2b , a + 3b… (which is indexes of 1,3,5,7…) - SERIES 2

if its odd, then the kth element is on series 1
if its even, then the kth element is on series 2

and then calculate the same.

Find the code below-
https://www.codechef.com/viewsolution/1088948567