TOTEM why I am getting WA?

MY logic is same as the editorial for
TOTEM.
Please give some test cases where solution give WA .
https://www.codechef.com/viewsolution/35812363