At a certain school, at the beginning of the year, the number of female students was 51 less than the number of male students. During the year, 19 males and 41 females dropped out, as a result, at the end of the year, the percentage of female students out of the total number of students was $4 \%$ less than it was at the beginning of the year. How many male and female students were there at the beginning of the year?
Let $x$ denote the number of girls at the beginning of the year. Then the number of girls and boys at the beginning and end of the year, respectively, is $x$ and $x+51$, and $x-41$ and $x+32$. Expressing the number of girls as a percentage of the total number of students, the problem's conditions lead to the following equation:

$$
\frac{100 x}{2 x+51}=\frac{100(x-41)}{2 x-9}+4
$$

Dividing the equation by 4, removing the fractions, and reducing to 0, we obtain an equation whose roots coincide with those of

$$
-4 x^{2}+466 x+52734=0
$$

or the

$$
2 x^{2}-233 x-26367=0
$$

equation, assuming that the latter differ from the roots of the removed denominators. The obtained equation has one positive and one negative root, of which only the former meets the conditions of the problem, so the number of girls at the beginning of the year is

$$
x=\frac{233+\sqrt{54289+210939}}{4}=\frac{233+515}{4}=187
$$

(which indeed is not a root of the removed denominators), and the number of boys was 238. (The girls made up $44 \%$ of all students at the beginning of the year, and $40 \%$ at the end of the year.)