The students of 8. A elected a representative to the school parliament from four candidates. They agreed that a majority of the votes (from those present) was needed for election, and each student, including the candidates, had one vote. In the first round, no one was elected. Anička was short of 3 votes, Petr was short of 9 votes, Mark was short of 5 votes, and Jitka was short of 4 votes. How many students are in the class if all the students of 8. A voted except for 5 students who did not participate in the voting due to illness? 

(Majer)
Let the number of students who voted be denoted as $x$.

We will divide the problem into two scenarios:

a) an even number of students voted,

b) an odd number of students voted.

First, let's solve the scenario where an even number of students voted. In this case, $\frac{1}{2} x+1$ votes were needed for election. Anička received $\frac{1}{2} x+1-3$ votes, Petr $\frac{1}{2} x+1-9$ votes, Marek $\frac{1}{2} x+1-5$ votes, and Jitka $\frac{1}{2} x+1-4$ votes. Since everyone voted, the following must hold:

$$
\frac{x}{2}+1-3+\frac{x}{2}+1-9+\frac{x}{2}+1-5+\frac{x}{2}+1-4=x .
$$

From this, $x=17$, which is an odd number and thus not our solution.

The second scenario - an odd number of students voted. In this case, $\frac{1}{2}(x+1)$ votes were needed for election. Anička received $\frac{1}{2}(x+1)-3$ votes, Petr $\frac{1}{2}(x+1)-9$ votes, Marek $\frac{1}{2}(x+1)-5$ votes, and Jitka $\frac{1}{2}(x+1)-4$ votes. Since everyone present voted, the following must hold:

$$
\frac{x+1}{2}-3+\frac{x+1}{2}-9+\frac{x+1}{2}-5+\frac{x+1}{2}-4=x .
$$

From this, $x=19$, which is indeed the solution we are looking for. If 5 students were absent due to illness, the total number of students in the class is $19+5=24$.