2. On an island, there are 1000 villages, each with 99 residents. Each resident of the island is either a knight, who always tells the truth, or a liar, who always lies. It is known that there are exactly 54054 knights on the island. One fine day, every resident of the island was asked the question: "Who is more in your village: knights or liars?" It turned out that in each village, 66 people answered that there were more knights, and 33 that there were more liars. How many villages on the island have more knights than liars?
Problem 622
Official solution
Answer: 638. Solution. There cannot be an equal number of knights and liars in any village, because then all its inhabitants would have lied. If there are more knights in a village, then obviously 66 people told the truth and 33 people lied, and if there are more liars - then the opposite. Let there be villages where there are more knights. Then, from the condition, it follows that . Solving this equation, we get the answer.