2 TEST CASE NOT SATISFIED

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

Yesterday I got a rely that my code will give incorrect ouput for 1 ababababb and correct output should be 4.
But according to me the ques the correct output should be the maximum number of equal strings.

Considering which it will give the ouput as 6 and not 4.
Please eleborate why output shoulb 4 and not 6.