Where is my mistake

Question: https://www.codechef.com/problems/WARRIORS

My Solution: https://www.codechef.com/viewsolution/26151930