problem:
a) Let $a, b, c, d$ be real numbers with $0 \leqslant a, b, c, d \leqslant 1$. Prove that

$$
a b(a-b)+b c(b-c)+c d(c-d)+d a(d-a) \leqslant \frac{8}{27}
$$

b) Find all quadruples $(a, b, c, d)$ of real numbers with $0 \leqslant a, b, c, d \leqslant 1$ for which equality holds in the above inequality.

solution:
Denote the left-hand side by $S$. We have

$$
\begin{aligned}
S & =a b(a-b)+b c(b-c)+c d(c-d)+d a(d-a) \\
& =a^{2} b-a b^{2}+b^{2} c-b c^{2}+c^{2} d-c d^{2}+d^{2} a-d a^{2} \\
& =a^{2}(b-d)+b^{2}(c-a)+c^{2}(d-b)+d^{2}(a-c) \\
& =(b-d)\left(a^{2}-c^{2}\right)+(c-a)\left(b^{2}-d^{2}\right) \\
& =(b-d)(a-c)(a+c)+(c-a)(b-d)(b+d) \\
& =(b-d)(a-c)(a+c-b-d) .
\end{aligned}
$$

Assume without loss of generality that $a \geqslant c$, then $a-c \geqslant 0$. Now we consider two cases.

- Suppose $b-d \geqslant 0$. Then if $a+c-b-d<0$ we have $S \leqslant 0$, so we're done. If $a+c-b-d \geqslant 0$, we use the AM-GM inequality on $a-c, b-d$ and $a+c-b-d$, which yields

$$
\sqrt[3]{S}=\sqrt[3]{(b-d)(a-c)(a+c-b-d)} \leqslant \frac{b-d+a-c+a+c-b-d}{3}=\frac{2 a-2 d}{3} \leqslant \frac{2}{3}
$$

so $S \leqslant \frac{8}{27}$.

- Suppose $b-d<0$. Then if $a+c-b-d \geqslant 0$ we have $S \leqslant 0$, so we're done. If $a+c-b-d<0$, we use the AM-GM inequality on $a-c, d-b$ and $b+d-a-c$, which yields

$$
\sqrt[3]{S}=\sqrt[3]{(d-b)(a-c)(b+d-a-c)} \leqslant \frac{d-b+a-c+b+d-a-c}{3}=\frac{2 d-2 c}{3} \leqslant \frac{2}{3}
$$

so $S \leqslant \frac{8}{27}$.

Equality in the first case occurs when $a-c=b-d=a+c-b-d$ and $a=1, d=0$. Then $1-c=b=1+c-b$, which implies $2 c=b=1-c$ and hence $c=\frac{1}{3}$. This results in $(a, b, c, d)=\left(1, \frac{2}{3}, \frac{1}{3}, 0\right)$. Similarly, equality in the second case occurs when $a-c=d-b=b+d-a-c$ and $d=1, c=0$. This yields $(a, b, c, d)=\left(\frac{2}{3}, \frac{1}{3}, 0,1\right)$. The case $a \leqslant c$ gives the other two cyclic variants, which gives all quadruples satisfying the equality.

problem_match: # Problem 1.

solution_match: Solution.


problem: Pawns and rooks are placed on a $2019 \times 2019$ chessboard, with at most one piece on each of the $2019^{2}$ squares. A rook can see another rook if they are in the same row or column and all squares between them are empty. What is the maximal number $p$ for which $p$ pawns and $p+2019$ rooks can be placed on the chessboard in such a way that no two rooks can see each other?

solution:
Answer: the maximal $p$ equals $1009^{2}$.
Write $n=2019$ and $k=1009$; then $n=2 k+1$. We first show that we can place $k^{2}$ pawns and $n+k^{2}$ rooks. Each cell of the chess board has coordinates $(x, y)$ with $1 \leqslant x, y \leqslant n$. We colour each cell black or white depending on whether $x+y$ is even or odd.

Let $A$ be cell $(1, k+1), B$ be cell $(k+1,1), C$ be cell $(2 k+1, k+1)$ and $D$ be cell $(k+1,2 k+1)$, and consider the skew square $A B C D$. We place rooks on the cells of this square which have the same colour as $A$, and we place pawns on the other cells of this square. In this way, no rook can see another rook. Now we have placed $p=k^{2}$ pawns and $(k+1)^{2}=k^{2}+(2 k+1)=p+n$ rooks.

Now we show that we can not place more pawns. Observe that in every row the number of rooks exceeds the number of pawns by at most 1 , since there has to be a pawn between every two neighbouring rooks. So the total number of rooks exceeds the number of pawns by at most $n$. On the other hand we are to place $p$ pawns and $p+n$ rooks, so the number of rooks in every row exceeds the number of pawns by exactly 1. This means that the rooks and pawns alternate, with rooks at the two ends. For the columns the same holds.

Consider the $\ell$-th row. Let $a$ be the number of pawns in this row and let $b$ be the number of pawns above the $\ell$-th row. For all these pawns, a rook must be somewhere above it. Counting the rooks directly above these $a+b$ pawns, we conclude that there must be at least $a+b$ rooks in the first $\ell-1$ rows. In every row the number of rooks exceeds the number of pawns by 1 , so in these first $\ell-1$ rows we have at least $a+b-(\ell-1)$ pawns. So $b \geqslant a+b-(\ell-1)$, yielding $a \leqslant \ell-1$. We conclude that the $\ell$-th row contains at most $\ell-1$ pawns. The same holds for the $\ell$-th row counted from below (row $(n+1)-\ell$ ): also in this row, there are at most $\ell-1$ pawns. As $n=2 k+1$, the maximal number $p$ is

$$
\sum_{\ell=1}^{k}(\ell-1)+\sum_{\ell=1}^{k+1}(\ell-1)=k+2 \cdot \frac{1}{2} k(k-1)=k+k(k-1)=k^{2}
$$

problem_match: Problem 2.


problem:
Two circles $\Gamma_{1}$ and $\Gamma_{2}$ intersect at points $A$ and $Z$ (with $A \neq Z$ ). Let $B$ be the centre of $\Gamma_{1}$ and let $C$ be the centre of $\Gamma_{2}$. The exterior angle bisector of $\angle B A C$ intersects $\Gamma_{1}$ again at $X$ and $\Gamma_{2}$ again at $Y$. Prove that the interior angle bisector of $\angle B Z C$ passes through the circumcentre of $\triangle X Y Z$.

For points $P, Q, R$ that lie on a line $\ell$ in that order, and a point $S$ not on $\ell$, the interior angle bisector of $\angle P Q S$ is the line that divides $\angle P Q S$ into two equal angles, while the exterior angle bisector of $\angle P Q S$ is the line that divides $\angle R Q S$ into two equal angles.

solution:
We first prove that $\angle A Z X=\angle Y Z A$. Since the triangles $\triangle B A X, \triangle C A Y$ are isosceles, and $X Y$ is the external bisector of $\angle B A C$, we see that

$$
\angle B X A=\angle X A B=\angle C A Y=\angle A Y C .
$$

Using these equalities, we find that

$$
\angle X B A=180^{\circ}-\angle B A X-\angle A X B=180^{\circ}-\angle C Y A-\angle Y A C=\angle A C Y
$$

Since $B, C$ are the centres of respectively $\Gamma_{1}, \Gamma_{2}$, this implies that

$$
\angle A Z X=\frac{1}{2} \angle A B X=\frac{1}{2} \angle Y C A=\angle Y Z A .
$$

Let $O$ be the circumcentre of $\triangle X Y Z$, next we will prove that $\angle B Z O=\angle A Z Y$. Consider the configuration where $\angle Z X A$ is sharp, then $\angle A B Z=2 \angle A X Z=2 \angle Y X Z=\angle Y O Z$. Since $\triangle B Z A$ and $\triangle O Z Y$ are isosceles, this implies $\angle B Z A=\angle O Z Y$. Subtracting $\angle O Z A$ (or adding, depending on the configuration) yields $\angle B Z O=\angle A Z Y$.
Together with the analogous result $\angle C Z O=\angle A Z X$, we conclude $\angle B Z O=\angle A Z Y=\angle X Z A=$ $\angle O Z C$, so $O$ lies indeed on the internal bisector of $\angle B Z C$.

problem_match: Problem 3.

solution_match: Solution I.


solution:
Let $O$ the circumcentre of $\triangle X Y Z$, then we see that $O X=O Z$. Since $B$ is the centre of $\Gamma_{1}$, we also see that $B X=B Z$, so $O B$ is the perpendicular bisector of $X Z$. Therefore $\angle B Z O=\angle B X O$, and analogously we find $\angle C Z O=\angle C Y O$. Note that $B, C$ lie on the same side of $X Y$; we will consider the configuration where $O$ is on the opposite side of $X Y$. Then $\angle B X O=\angle B X A+\angle A X O$. Now the isosceles triangles $\triangle B X A, \triangle C A Y, \triangle O X Y$, and $X Y$ being the external bisector of $\angle B A C$ give

$$
\begin{aligned}
& \angle B X A=\angle X A B=\angle C A Y=\angle A Y C, \\
& \angle A X O=\angle Y X O=\angle O Y X=\angle O Y A,
\end{aligned}
$$

so we find that $\angle B Z O=\angle B X O=\angle A Y C+\angle O Y A=\angle O Y C=\angle O Z C$. Hence $O$ lies on the internal bisector of $\angle B Z C$.

solution_match: Solution II.


problem:
An integer $m>1$ is rich if for any positive integer $n$, there exist positive integers $x, y, z$ such that $n=m x^{2}-y^{2}-z^{2}$. An integer $m>1$ is poor if it is not rich.
a) Find a poor integer.
b) Find a rich integer.
a) Solution I. We will show that $m=4$ is poor. If $y$ and $z$ are both even, we have $4 x^{2}-y^{2}-z^{2} \equiv$ $0-0-0=0(\bmod 4)$. If $y$ is even and $z$ is odd or the other way around, then $4 x^{2}-y^{2}-z^{2} \equiv$ $0-0-1 \equiv 3(\bmod 4)$. If $y$ and $z$ are both odd, we have $4 x^{2}-y^{2}-z^{2} \equiv 0-1-1 \equiv 2(\bmod 4)$. Hence it is impossible to write any integer $n \equiv 1(\bmod 4)$ as $n=m x^{2}-y^{2}-z^{2}$. So $m=4$ is poor.

solution:
We will show that $m=3$ is poor, by proving that it is impossible to write any integer $n \equiv 5(\bmod 8)$ as $n=3 x^{2}-y^{2}-z^{2}$. We consider the equation modulo 8 . If $4 \mid x$, then $n \equiv-y^{2}-z^{2}(\bmod 8)$. So if $n \equiv 5(\bmod 8)$, we need to have $y^{2}+z^{2} \equiv 3(\bmod 8)$. As $y^{2}$ and $z^{2}$ can only be 0,1 or $4 \bmod 8$, this is impossible. If $x \equiv 2(\bmod 4)$, then $3 x^{2} \equiv 4(\bmod 8)$, so for $n \equiv 5(\bmod 8)$ we need to have $y^{2}+z^{2} \equiv 7(\bmod 8)$. Again, this is impossible. Finally, if $x$ is odd, then $3 x^{2} \equiv 3(\bmod 8)$, so for $n \equiv 5(\bmod 8)$ we need to have $y^{2}+z^{2} \equiv 6(\bmod 8)$. This is impossible as well. So $m=3$ is poor.
b) Solution I. We will show that $m=5$ is rich. For any integer $x \geqslant 2$ we can take $y=2 x-2$ and $z=x+3$, then

$$
5 x^{2}-y^{2}-z^{2}=5 x^{2}-\left(4 x^{2}-8 x+4\right)-\left(x^{2}+6 x+9\right)=2 x-13
$$

For $x \geqslant 7$, this gives us all odd positive integers.
For any integer $x \geqslant 1$ we can take $y=2 x-1$ and $z=x+1$, then

$$
5 x^{2}-y^{2}-z^{2}=5 x^{2}-\left(4 x^{2}-4 x+1\right)-\left(x^{2}+2 x+1\right)=2 x-2
$$

For $x \geqslant 2$, this gives us all even positive integers. So $m=5$ is rich.

problem_match: Problem 4.


solution:
We will show that $m=2$ is rich. For any integer $x \geqslant 3$ we can take $y=x+1$ and $z=x-2$, then

$$
2 x^{2}-y^{2}-z^{2}=2 x^{2}-\left(x^{2}+2 x+1\right)-\left(x^{2}-4 x+4\right)=2 x-5 .
$$

As $x$ can take any positive integer value that is at least 3 , this gives us all odd positive integers.
For any integer $x \geqslant 5$ we can take $y=x+2$ and $z=x-4$, then

$$
2 x^{2}-y^{2}-z^{2}=2 x^{2}-\left(x^{2}+4 x+4\right)-\left(x^{2}-8 x+16\right)=4 x-20 .
$$

For $x \geqslant 6$, this gives us all positive integers divisible by 4 .
For any integer $x \geqslant 6$ we can take $y=x+3$ and $z=x-5$, then

$$
2 x^{2}-y^{2}-z^{2}=2 x^{2}-\left(x^{2}+6 x+9\right)-\left(x^{2}-10 x+25\right)=4 x-34
$$

For $x \geqslant 9$, this gives us all positive integers in the residue class $2(\bmod 4)$. So $m=2$ is rich.

Remark. Considering the equation modulo 8 and 9 , we can show that $m$ is poor when $m \equiv 0,3(\bmod 4)$ or $m \equiv 0(\bmod 3)$. This shows that $6,7,8,9,11,12$ are also poor. Further you can find a construction showing that $m=10$ is rich.