HELP ! debug - Codechef STARTERS 24 (Yet Another Constructive Problem)

Here is the question : Contest Page | CodeChef
and this is my solution
Solution: 57544409 | CodeChef

It is working fine for all cases, according to me. Can anyone please help me with the case where this fails!!! Thanks in advance!..

Check for x = 1

Thanks a lot, small error!!

1 Like