Somethings wrong with the test case with C, exaclly i use
fflush(stdin);gets(input) → wrong answer
but when i used scanf(“%s”,input) → AC
check my problem
https://www.codechef.com/viewsolution/30684983
and
https://www.codechef.com/viewsolution/30684943