problem: https://www.codechef.com/CHN15ROL/problems/CHN15B

What is the approach to solve this problem, I tried to view this code

https://www.codechef.com/viewsolution/8972785

But I didn’t understand what logic he is using.

How the maximum possible teams could be = ((no. of players with no choice)/2)+1;

I mean, when petr tries to fill the choice of the players who have not filled the choice, he may get head every time so he will leave all those choices as it is, so answer could be equal to n if no player has filled the choice.