Consider the test input:
1
fff
1 Like
First, input test cases and print each answer on a newline.
First of all your code was not handling multiple test cases and there was a problem in line 14 of your solution.
Here is the modified code:https://www.codechef.com/viewsolution/36176715