4. Adam and Bohouš participated in a tournament played in a round-robin system, where each player was supposed to play one match per day. However, Adam and Bohouš were the only ones who did not complete the tournament due to illness. Bohouš withdrew five days earlier than Adam. In total, 350 matches were played. How many matches did Adam play? Did he play against Bohouš?
SOLUTION. Every day, the players were divided into pairs, in which they were to play their match. The total number of players was therefore even, let's denote it as $2n$. Every day, $n$ matches were to be played, and the tournament was scheduled for $2n-1$ days. Let's assume that Adam withdrew $d$ days before the end of the tournament and Bohouš $d+5$ days before the end.

If Adam and Bohouš did play against each other, the number of matches that were canceled due to their illness is as many as they both did not play, i.e., a total of $2d+5$. If they did not play against each other, only $2d+4$ matches were canceled. According to this, either

$$
n(2n-1) = 355 + 2d, \quad \text{or} \quad n(2n-1) = 354 + 2d.
$$

From the equations, we can infer both an estimate $2n^2 > 354$, but also $n(2n-5) < 354$. From the first, we get $n > 13$, and from the second, $n < 15$ (for $n \geq 15$, $n(2n-5) \geq 375$). Therefore, necessarily $n = 14$. At the same time, we see that the left side of each of the two previous equations is even for $n = 14$, so only the second one can hold. From it, we calculate $d = 12$. The tournament thus lasted $2n-1 = 27$ days, and Adam withdrew 12 days before the end of the tournament, played 15 matches, and did not play against Bohouš.

GUIDING PROBLEMS: