Chef of the Year - CVOTE

I’m getting WA for CVOTE(Chef of the Year) problem. I’ve applied the same logic as stated in the hints. Can you please tell what is wrong with my code…?

Code link

Can you also suggest another way to find the lexicographically smallest country and chef in this problem…?

Thanks in advance…!