di-zhang-fdu/OlympiadExtended huggingface dataset:
Subfield: Combinatorics


Question: Let $n$ be an integer with $n \geqslant 2$. On a slope of a mountain, $n^{2}$ checkpoints are marked, numbered from 1 to $n^{2}$ from the bottom to the top. Each of two cable car companies, $A$ and $B$, operates $k$ cable cars numbered from 1 to $k$; each cable car provides a transfer from some checkpoint to a higher one. For each company, and for any $i$ and $j$ with $1 \leqslant i<j \leqslant k$, the starting point of car $j$ is higher than the starting point of car $i$; similarly, the finishing point of car $j$ is higher than the finishing point of car $i$. Say that two checkpoints are linked by some company if one can start from the lower checkpoint and reach the higher one by using one or more cars of that company (no movement on foot is allowed).

Determine the smallest $k$ for which one can guarantee that there are two checkpoints that are linked by each of the two companies.

Solution:
We start with showing that for any $k \leqslant n^{2}-n$ there may be no pair of checkpoints linked by both companies. Clearly, it suffices to provide such an example for $k=n^{2}-n$.

Let company $A$ connect the pairs of checkpoints of the form $(i, i+1)$, where $n \nmid i$. Then all pairs of checkpoints $(i, j)$ linked by $A$ satisfy $\lceil i / n\rceil=\lceil j / n\rceil$.

Let company $B$ connect the pairs of the form $(i, i+n)$, where $1 \leqslant i \leqslant n^{2}-n$. Then pairs of checkpoints $(i, j)$ linked by $B$ satisfy $i \equiv j(\bmod n)$. Clearly, no pair $(i, j)$ satisfies both conditions, so there is no pair linked by both companies.

Now we show that for $k=n^{2}-n+1$ there always exist two required checkpoints. Define an $A$-chain as a sequence of checkpoints $a_{1}<a_{2}<\ldots<a_{t}$ such that company $A$ connects $a_{i}$ with $a_{i+1}$ for all $1 \leqslant i \leqslant t-1$, but there is no $A$-car transferring from some checkpoint to $a_{1}$ and no $A$-car transferring from $a_{t}$ to any other checkpoint. Define $B$-chains similarly. Moving forth and back, one easily sees that any checkpoint is included in a unique $A$-chain (possibly consisting of that single checkpoint), as well as in a unique $B$-chain. Now, put each checkpoint into a correspondence to the pair of the $A$-chain and the $B$-chain it belongs to.

All finishing points of $A$-cars are distinct, so there are $n^{2}-k=n-1$ checkpoints that are not such finishing points. Each of them is a starting point of a unique $A$-chain, so the number of $A$-chains is $n-1$. Similarly, the number of $B$-chains also equals $n-1$. Hence, there are $(n-1)^{2}$ pairs consisting of an $A$ - and a $B$-chain. Therefore, two of the $n^{2}$ checkpoints correspond to the same pair, so that they belong to the same $A$-chain, as well as to the same $B$-chain. This means that they are linked by both companies, as required.

Final answer: $n^{2}-n+1$
Subfield: Combinatorics


Question: The Fibonacci numbers $F_{0}, F_{1}, F_{2}, \ldots$ are defined inductively by $F_{0}=0, F_{1}=1$, and $F_{n+1}=F_{n}+F_{n-1}$ for $n \geqslant 1$. Given an integer $n \geqslant 2$, determine the smallest size of a set $S$ of integers such that for every $k=2,3, \ldots, n$ there exist some $x, y \in S$ such that $x-y=F_{k}$.

Solution:
First we show that if a set $S \subset \mathbb{Z}$ satisfies the conditions then $|S| \geqslant \frac{n}{2}+1$.

Let $d=\lceil n / 2\rceil$, so $n \leqslant 2 d \leqslant n+1$. In order to prove that $|S| \geqslant d+1$, construct a graph as follows. Let the vertices of the graph be the elements of $S$. For each $1 \leqslant k \leqslant d$, choose two elements $x, y \in S$ such that $x-y=F_{2 k-1}$, and add the pair $(x, y)$ to the graph as edge. (Note that by the problem's constraints, there must be a pair $(x, y)$ with $x-y=F_{2 k-1}$ for every $3 \leqslant 2 k-1 \leqslant 2 d-1 \leqslant n$; moreover, due to $F_{1}=F_{2}$ we have a pair with $x-y=F_{1}$ as well.) We will say that the length of the edge $(x, y)$ is $|x-y|$.

We claim that the graph contains no cycle. For the sake of contradiction, suppose that the graph contains a cycle $\left(x_{1}, \ldots, x_{\ell}\right)$, and let the longest edge in the cycle be $\left(x_{1}, x_{\ell}\right)$ with length $F_{2 m+1}$. The other edges $\left(x_{1}, x_{2}\right), \ldots,\left(x_{\ell-1}, x_{\ell}\right)$ in the cycle are shorter than $F_{2 m+1}$ and distinct, their lengths form a subset of $\left\{F_{1}, F_{3}, \ldots, F_{2 m-1}\right\}$. But this is not possible because

$$
\begin{aligned}
F_{2 m+1} & =\left|x_{\ell}-x_{1}\right| \leqslant \sum_{i=1}^{\ell-1}\left|x_{i+1}-x_{i}\right| \leqslant F_{1}+F_{3}+F_{5}+\ldots+F_{2 m-1} \\
& =F_{2}+\left(F_{4}-F_{2}\right)+\left(F_{6}-F_{4}\right)+\ldots+\left(F_{2 m}-F_{2 m-2}\right)=F_{2 m}<F_{2 m+1} .
\end{aligned}
$$

Hence, the graph has $d$ edges and cannot contain a cycle, therefore it must contain at least $d+1$ vertices, so $|S| \geqslant d+1$.

Now we show a suitable set with $d+1$ elements. Let

$$
S=\left\{F_{0}, F_{2}, F_{4}, F_{5}, \ldots, F_{2 d}\right\}
$$

For $1 \leqslant k \leqslant d$ we have $F_{0}, F_{2 k-2}, F_{2 k} \in S$ with differences $F_{2 k}-F_{2 k-2}=F_{2 k-1}$ and $F_{2 k}-F_{0}=F_{2 k}$, so each of $F_{1}, F_{2}, \ldots, F_{2 d}$ occurs as difference between two elements in $S$. So this set containing $d+1$ numbers is suitable.



This page is intentionally left blank

Final answer: $\lceil n / 2\rceil+1$
Subfield: Combinatorics


Question: Let $p$ be an odd prime, and put $N=\frac{1}{4}\left(p^{3}-p\right)-1$. The numbers $1,2, \ldots, N$ are painted arbitrarily in two colors, red and blue. For any positive integer $n \leqslant N$, denote by $r(n)$ the fraction of integers in $\{1,2, \ldots, n\}$ that are red.

Prove that there exists a positive integer $a \in\{1,2, \ldots, p-1\}$ such that $r(n) \neq a / p$ for all $n=1,2, \ldots, N$.

Solution:
Denote by $R(n)$ the number of red numbers in $\{1,2, \ldots, n\}$, i.e., $R(n)=n r(n)$. Similarly, denote by $B(n)$ and $b(n)=B(n) / n$ the number and proportion of blue numbers in $\{1,2, \ldots, n\}$, respectively. Notice that $B(n)+R(n)=n$ and $b(n)+r(n)=1$. Therefore, the statement of the problem does not change after swapping the colors.

Arguing indirectly, for every $a \in\{1,2, \ldots, p-1\}$ choose some positive integer $n_{a}$ such that $r\left(n_{a}\right)=a / p$ and, hence, $R\left(n_{a}\right)=a n_{a} / p$. Clearly, $p \mid n_{a}$, so that $n_{a}=p m_{a}$ for some positive integer $m_{a}$, and $R\left(n_{a}\right)=a m_{a}$. Without loss of generality, we assume that $m_{1}<m_{p-1}$, as otherwise one may swap the colors. Notice that

$$
m_{a} \leqslant \frac{N}{p}<\frac{p^{2}-1}{4} \quad \text { for all } a=1,2, \ldots, p-1
\tag{1}
$$

The solution is based on a repeated application of the following simple observation.

Claim. Assume that $m_{a}<m_{b}$ for some $a, b \in\{1,2, \ldots, p-1\}$. Then

$$
m_{b} \geqslant \frac{a}{b} m_{a} \quad \text { and } \quad m_{b} \geqslant \frac{p-a}{p-b} m_{a}
$$

Proof. The first inequality follows from $b m_{b}=R\left(n_{b}\right) \geqslant R\left(n_{a}\right)=a m_{a}$. The second inequality is obtained by swapping colors .

Let $q=(p-1) / 2$. We distinguish two cases.

Case 1: All $q$ numbers $m_{1}, m_{2}, \ldots, m_{q}$ are smaller than $m_{p-1}$.

Let $m_{a}$ be the maximal number among $m_{1}, m_{2}, \ldots, m_{q}$; then $m_{a} \geqslant q \geqslant a$. Applying the Claim, we get

$$
m_{p-1} \geqslant \frac{p-a}{p-(p-1)} m_{a} \geqslant(p-q) q=\frac{p^{2}-1}{4}
$$

which contradicts (1).

Case 2: There exists $k \leqslant q$ such that $m_{k}>m_{p-1}$.

Choose $k$ to be the smallest index satisfying $m_{k}>m_{p-1}$; by our assumptions, we have $1<k \leqslant$ $q<p-1$.

Let $m_{a}$ be the maximal number among $m_{1}, m_{2}, \ldots, m_{k-1}$; then $a \leqslant k-1 \leqslant m_{a}<m_{p-1}$. Applying the Claim, we get

$$
\begin{aligned}
m_{k} \geqslant \frac{p-1}{k} m_{p-1} \geqslant \frac{p-1}{k} & \cdot \frac{p-a}{p-(p-1)} m_{a} \\
& \geqslant \frac{p-1}{k} \cdot(p-k+1)(k-1) \geqslant \frac{k-1}{k} \cdot(p-1)(p-q) \geqslant \frac{1}{2} \cdot \frac{p^{2}-1}{2}
\end{aligned}
$$

which contradicts (1) again.
Subfield: Geometry


Question: Let $A B C$ be an isosceles triangle with $B C=C A$, and let $D$ be a point inside side $A B$ such that $A D<D B$. Let $P$ and $Q$ be two points inside sides $B C$ and $C A$, respectively, such that $\angle D P B=\angle D Q A=90^{\circ}$. Let the perpendicular bisector of $P Q$ meet line segment $C Q$ at $E$, and let the circumcircles of triangles $A B C$ and $C P Q$ meet again at point $F$, different from $C$.

Suppose that $P, E, F$ are collinear. Prove that $\angle A C B=90^{\circ}$.

Solution:
Let $\ell$ be the perpendicular bisector of $P Q$, and denote by $\omega$ the $\operatorname{circle~} C F P Q$. By $D P \perp B C$ and $D Q \perp A C$, the circle $\omega$ passes through $D$; moreover, $C D$ is a diameter of $\omega$.

The lines $Q E$ and $P E$ are symmetric about $\ell$, and $\ell$ is a symmetry axis of $\omega$ as well; it follows that the chords $C Q$ and $F P$ are symmetric about $\ell$, hence $C$ and $F$ are symmetric about $\ell$. Therefore, the perpendicular bisector of $C F$ coincides with $\ell$. Thus $\ell$ passes through the circumcenter $O$ of $A B C$.

Let $M$ be the midpoint of $A B$. Since $C M \perp D M, M$ also lies on $\omega$. By $\angle A C M=\angle B C M$, the chords $M P$ and $M Q$ of $\omega$ are equal. Then, from $M P=M Q$ it follows that $\ell$ passes through $M$.

<img_3394>

Finally, both $O$ and $M$ lie on lines $\ell$ and $C M$, therefore $O=M$, and $\angle A C B=90^{\circ}$ follows.
Like in the first solution, we conclude that points $C, P, Q, D, F$ and the midpoint $M$ of $A B$ lie on one circle $\omega$ with diameter $C D$, and $M$ lies on $\ell$, the perpendicular bisector of $P Q$.

Let $B F$ and $C M$ meet at $G$ and let $\alpha=\angle A B F$. Then, since $E$ lies on $\ell$, and the quadrilaterals $F C B A$ and $F C P Q$ are cyclic, we have

$$
\angle C Q P=\angle F P Q=\angle F C Q=\angle F C A=\angle F B A=\alpha
$$

Since points $P, E, F$ are collinear, we have

$$
\angle F E M=\angle F E Q+\angle Q E M=2 \alpha+\left(90^{\circ}-\alpha\right)=90^{\circ}+\alpha
$$

But $\angle F G M=90^{\circ}+\alpha$, so $F E G M$ is cyclic. Hence

$$
\angle E G C=\angle E F M=\angle P F M=\angle P C M .
$$

Thus $G E \| B C$. It follows that $\angle F A C=\angle C B F=\angle E G F$, so $F E G A$ is cyclic, too. Hence $\angle A C B=\angle A F B=\angle A F G=180^{\circ}-\angle A M G=90^{\circ}$, that completes the proof.



<img_3472>
Subfield: Geometry


Question: Let $A B C D$ be a convex quadrilateral. Suppose that $P$ is a point in the interior of $A B C D$ such that

$$
\angle P A D: \angle P B A: \angle D P A=1: 2: 3=\angle C B P: \angle B A P: \angle B P C .
$$

The internal bisectors of angles $A D P$ and $P C B$ meet at a point $Q$ inside the triangle $A B P$. Prove that $A Q=B Q$.

Solution:
Let $\varphi=\angle P A D$ and $\psi=\angle C B P$; then we have $\angle P B A=2 \varphi, \angle D P A=3 \varphi$, $\angle B A P=2 \psi$ and $\angle B P C=3 \psi$. Let $X$ be the point on segment $A D$ with $\angle X P A=\varphi$. Then

$$
\angle P X D=\angle P A X+\angle X P A=2 \varphi=\angle D P A-\angle X P A=\angle D P X
$$

It follows that triangle $D P X$ is isosceles with $D X=D P$ and therefore the internal angle bisector of $\angle A D P$ coincides with the perpendicular bisector of $X P$. Similarly, if $Y$ is a point on $B C$ such that $\angle B P Y=\psi$, then the internal angle bisector of $\angle P C B$ coincides with the perpendicular bisector of $P Y$. Hence, we have to prove that the perpendicular bisectors of $X P$, $P Y$, and $A B$ are concurrent.

<img_3262>

Notice that

$$
\angle A X P=180^{\circ}-\angle P X D=180^{\circ}-2 \varphi=180^{\circ}-\angle P B A .
$$

Hence the quadrilateral $A X P B$ is cyclic; in other words, $X$ lies on the circumcircle of triangle $A P B$. Similarly, $Y$ lies on the circumcircle of triangle $A P B$. It follows that the perpendicular bisectors of $X P, P Y$, and $A B$ all pass through the center of circle $(A B Y P X)$. This finishes the proof.
We define the angles $\varphi=\angle P A D, \psi=\angle C B P$ and use $\angle P B A=2 \varphi, \angle D P A=$ $3 \varphi, \angle B A P=2 \psi$ and $\angle B P C=3 \psi$ again. Let $O$ be the circumcenter of $\triangle A P B$.

Notice that $\angle A D P=180^{\circ}-\angle P A D-\angle D P A=180^{\circ}-4 \varphi$, which, in particular, means that $4 \varphi<180^{\circ}$. Further, $\angle P O A=2 \angle P B A=4 \varphi=180^{\circ}-\angle A D P$, therefore the quadrilateral $A D P O$ is cyclic. By $A O=O P$, it follows that $\angle A D O=\angle O D P$. Thus $D O$ is the internal bisector of $\angle A D P$. Similarly, $C O$ is the internal bisector of $\angle P C B$.



<img_3474>

Finally, $O$ lies on the perpendicular bisector of $A B$ as it is the circumcenter of $\triangle A P B$. Therefore the three given lines in the problem statement concur at point $O$.
Subfield: Geometry


Question: Let $A B C D$ be a convex quadrilateral with $\angle A B C>90^{\circ}, \angle C D A>90^{\circ}$, and $\angle D A B=\angle B C D$. Denote by $E$ and $F$ the reflections of $A$ in lines $B C$ and $C D$, respectively. Suppose that the segments $A E$ and $A F$ meet the line $B D$ at $K$ and $L$, respectively. Prove that the circumcircles of triangles $B E K$ and $D F L$ are tangent to each other.

Solution:
Denote by $A^{\prime}$ the reflection of $A$ in $B D$. We will show that that the quadrilaterals $A^{\prime} B K E$ and $A^{\prime} D L F$ are cyclic, and their circumcircles are tangent to each other at point $A^{\prime}$.

From the symmetry about line $B C$ we have $\angle B E K=\angle B A K$, while from the symmetry in $B D$ we have $\angle B A K=\angle B A^{\prime} K$. Hence $\angle B E K=\angle B A^{\prime} K$, which implies that the quadrilateral $A^{\prime} B K E$ is cyclic. Similarly, the quadrilateral $A^{\prime} D L F$ is also cyclic.

<img_3896>

For showing that circles $A^{\prime} B K E$ and $A^{\prime} D L F$ are tangent it suffices to prove that

$$
\angle A^{\prime} K B+\angle A^{\prime} L D=\angle B A^{\prime} D .
$$

Indeed, by $A K \perp B C, A L \perp C D$, and again the symmetry in $B D$ we have

$$
\angle A^{\prime} K B+\angle A^{\prime} L D=180^{\circ}-\angle K A^{\prime} L=180^{\circ}-\angle K A L=\angle B C D=\angle B A D=\angle B A^{\prime} D,
$$

as required.
Note that $\angle K A L=180^{\circ}-\angle B C D$, since $A K$ and $A L$ are perpendicular to $B C$ and $C D$, respectively. Reflect both circles $(B E K)$ and $(D F L)$ in $B D$. Since $\angle K E B=\angle K A B$ and $\angle D F L=\angle D A L$, the images are the circles $(K A B)$ and $(L A D)$, respectively; so they meet at $A$. We need to prove that those two reflections are tangent at $A$.

For this purpose, we observe that

$$
\angle A K B+\angle A L D=180^{\circ}-\angle K A L=\angle B C D=\angle B A D .
$$

Thus, there exists a ray $A P$ inside angle $\angle B A D$ such that $\angle B A P=\angle A K B$ and $\angle D A P=$ $\angle D L A$. Hence the line $A P$ is a common tangent to the circles $(K A B)$ and $(L A D)$, as desired.
Subfield: Geometry


Question: In the plane, there are $n \geqslant 6$ pairwise disjoint disks $D_{1}, D_{2}, \ldots, D_{n}$ with radii $R_{1} \geqslant R_{2} \geqslant \ldots \geqslant R_{n}$. For every $i=1,2, \ldots, n$, a point $P_{i}$ is chosen in disk $D_{i}$. Let $O$ be an arbitrary point in the plane. Prove that

$$
O P_{1}+O P_{2}+\ldots+O P_{n} \geqslant R_{6}+R_{7}+\ldots+R_{n}
$$

Solution:
We will make use of the following lemma.

Lemma. Let $D_{1}, \ldots, D_{6}$ be disjoint disks in the plane with radii $R_{1}, \ldots, R_{6}$. Let $P_{i}$ be a point in $D_{i}$, and let $O$ be an arbitrary point. Then there exist indices $i$ and $j$ such that $O P_{i} \geqslant R_{j}$.

Proof. Let $O_{i}$ be the center of $D_{i}$. Consider six rays $O O_{1}, \ldots, O O_{6}$ (if $O=O_{i}$, then the ray $O O_{i}$ may be assumed to have an arbitrary direction). These rays partition the plane into six angles (one of which may be non-convex) whose measures sum up to $360^{\circ}$; hence one of the angles, say $\angle O_{i} O O_{j}$, has measure at most $60^{\circ}$. Then $O_{i} O_{j}$ cannot be the unique largest side in (possibly degenerate) triangle $O O_{i} O_{j}$, so, without loss of generality, $O O_{i} \geqslant O_{i} O_{j} \geqslant R_{i}+R_{j}$. Therefore, $O P_{i} \geqslant O O_{i}-R_{i} \geqslant\left(R_{i}+R_{j}\right)-R_{i}=R_{j}$, as desired.

Now we prove the required inequality by induction on $n \geqslant 5$. The base case $n=5$ is trivial. For the inductive step, apply the Lemma to the six largest disks, in order to find indices $i$ and $j$ such that $1 \leqslant i, j \leqslant 6$ and $O P_{i} \geqslant R_{j} \geqslant R_{6}$. Removing $D_{i}$ from the configuration and applying the inductive hypothesis, we get

$$
\sum_{k \neq i} O P_{k} \geqslant \sum_{\ell \geqslant 7} R_{\ell}
$$

Adding up this inequality with $O P_{i} \geqslant R_{6}$ we establish the inductive step.
Subfield: Number Theory


Question: Given a positive integer $k$, show that there exists a prime $p$ such that one can choose distinct integers $a_{1}, a_{2}, \ldots, a_{k+3} \in\{1,2, \ldots, p-1\}$ such that $p$ divides $a_{i} a_{i+1} a_{i+2} a_{i+3}-i$ for all $i=1,2, \ldots, k$.

Solution:
First we choose distinct positive rational numbers $r_{1}, \ldots, r_{k+3}$ such that

$$
r_{i} r_{i+1} r_{i+2} r_{i+3}=i \text { for } 1 \leqslant i \leqslant k .
$$

Let $r_{1}=x, r_{2}=y, r_{3}=z$ be some distinct primes greater than $k$; the remaining terms satisfy $r_{4}=\frac{1}{r_{1} r_{2} r_{3}}$ and $r_{i+4}=\frac{i+1}{i} r_{i}$. It follows that if $r_{i}$ are represented as irreducible fractions, the numerators are divisible by $x$ for $i \equiv 1(\bmod 4)$, by $y$ for $i \equiv 2(\bmod 4)$, by $z$ for $i \equiv 3(\bmod 4)$ and by none for $i \equiv 0(\bmod 4)$. Notice that $r_{i}<r_{i+4}$; thus the sequences $r_{1}<r_{5}<r_{9}<\ldots$, $r_{2}<r_{6}<r_{10}<\ldots, r_{3}<r_{7}<r_{11}<\ldots, r_{4}<r_{8}<r_{12}<\ldots$ are increasing and have no common terms, that is, all $r_{i}$ are distinct.

If each $r_{i}$ is represented by an irreducible fraction $\frac{u_{i}}{v_{i}}$, choose a prime $p$ which divides neither $v_{i}, 1 \leqslant i \leqslant k+1$, nor $v_{i} v_{j}\left(r_{i}-r_{j}\right)=v_{j} u_{i}-v_{i} u_{j}$ for $i<j$, and define $a_{i}$ by the congruence $a_{i} v_{i} \equiv u_{i}(\bmod p)$. Since $r_{i} r_{i+1} r_{i+2} r_{i+3}=i$, we have

$$
\begin{aligned}
& i v_{i} v_{i+1} v_{i+2} v_{i+3}=r_{i} v_{i} r_{i+1} v_{i+1} r_{i+2} v_{i+2} r_{i+3} v_{i+3} \\
& \quad=u_{i} u_{i+1} u_{i+2} u_{i+3} \equiv a_{i} v_{i} a_{i+1} v_{i+1} a_{i+2} v_{i+2} a_{i+3} v_{i+3} \quad(\bmod p)
\end{aligned}
$$

and therefore $a_{i} a_{i+1} a_{i+2} a_{i+3} \equiv i(\bmod p)$ for $1 \leqslant i \leqslant k$.

If $a_{i} \equiv a_{j}(\bmod p)$, then $u_{i} v_{j} \equiv a_{i} v_{i} v_{j} \equiv u_{j} v_{i}(\bmod p)$, a contradiction.
Subfield: Algebra


Question: Let $\mathbb{Z}$ be the set of integers. Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that, for all integers $a$ and $b$,

$$
f(2 a)+2 f(b)=f(f(a+b)) .
\tag{1}
$$

Solution:
Substituting $a=0, b=n+1$ gives $f(f(n+1))=f(0)+2 f(n+1)$. Substituting $a=1, b=n$ gives $f(f(n+1))=f(2)+2 f(n)$.

In particular, $f(0)+2 f(n+1)=f(2)+2 f(n)$, and so $f(n+1)-f(n)=\frac{1}{2}(f(2)-f(0))$. Thus $f(n+1)-f(n)$ must be constant. Since $f$ is defined only on $\mathbb{Z}$, this tells us that $f$ must be a linear function; write $f(n)=M n+K$ for arbitrary constants $M$ and $K$, and we need only determine which choices of $M$ and $K$ work.

Now, (1) becomes

$$
2 M a+K+2(M b+K)=M(M(a+b)+K)+K
$$

which we may rearrange to form

$$
(M-2)(M(a+b)+K)=0 .
$$

Thus, either $M=2$, or $M(a+b)+K=0$ for all values of $a+b$. In particular, the only possible solutions are $f(n)=0$ and $f(n)=2 n+K$ for any constant $K \in \mathbb{Z}$, and these are easily seen to work.
Let $K=f(0)$.

First, put $a=0$ in (1); this gives

$$
f(f(b))=2 f(b)+K
\tag{2}
$$

for all $b \in \mathbb{Z}$.

Now put $b=0$ in (1); this gives

$$
f(2 a)+2 K=f(f(a))=2 f(a)+K
$$

where the second equality follows from (2). Consequently,

$$
f(2 a)=2 f(a)-K
\tag{3}
$$

for all $a \in \mathbb{Z}$.

Substituting (2) and (3) into (1), we obtain

$$
\begin{aligned}
f(2 a)+2 f(b) & =f(f(a+b)) \\
2 f(a)-K+2 f(b) & =2 f(a+b)+K \\
f(a)+f(b) & =f(a+b)+K
\end{aligned}
$$



Thus, if we set $g(n)=f(n)-K$ we see that $g$ satisfies the Cauchy equation $g(a+b)=$ $g(a)+g(b)$. The solution to the Cauchy equation over $\mathbb{Z}$ is well-known; indeed, it may be proven by an easy induction that $g(n)=M n$ for each $n \in \mathbb{Z}$, where $M=g(1)$ is a constant.

Therefore, $f(n)=M n+K$. Now, (1) becomes

$$
2 M a+K+2(M b+K)=M(M(a+b)+K)+K
$$

which we may rearrange to form

$$
(M-2)(M(a+b)+K)=0 .
$$

Thus, either $M=2$, or $M(a+b)+K=0$ for all values of $a+b$. In particular, the only possible solutions are $f(n)=0$ and $f(n)=2 n+K$ for any constant $K \in \mathbb{Z}$, and these are easily seen to work.

Final answer: $f(n)=0$ and $f(n)=2 n+K$ for any constant $K \in \mathbb{Z}$
Subfield: Algebra


Question: Let $u_{1}, u_{2}, \ldots, u_{2019}$ be real numbers satisfying

$$
u_{1}+u_{2}+\cdots+u_{2019}=0 \quad \text { and } \quad u_{1}^{2}+u_{2}^{2}+\cdots+u_{2019}^{2}=1 .
$$

Let $a=\min \left(u_{1}, u_{2}, \ldots, u_{2019}\right)$ and $b=\max \left(u_{1}, u_{2}, \ldots, u_{2019}\right)$. Prove that

$$
a b \leqslant-\frac{1}{2019}
$$

Solution:
Notice first that $b>0$ and $a<0$. Indeed, since $\sum_{i=1}^{2019} u_{i}^{2}=1$, the variables $u_{i}$ cannot be all zero, and, since $\sum_{i=1}^{2019} u_{i}=0$, the nonzero elements cannot be all positive or all negative.

Let $P=\left\{i: u_{i}>0\right\}$ and $N=\left\{i: u_{i} \leqslant 0\right\}$ be the indices of positive and nonpositive elements in the sequence, and let $p=|P|$ and $n=|N|$ be the sizes of these sets; then $p+n=2019$. By the condition $\sum_{i=1}^{2019} u_{i}=0$ we have $0=\sum_{i=1}^{2019} u_{i}=\sum_{i \in P} u_{i}-\sum_{i \in N}\left|u_{i}\right|$, so

$$
\sum_{i \in P} u_{i}=\sum_{i \in N}\left|u_{i}\right|
\tag{1}
$$

After this preparation, estimate the sum of squares of the positive and nonpositive elements as follows:

$$
\sum_{i \in P} u_{i}^{2} \leqslant \sum_{i \in P} b u_{i}=b \sum_{i \in P} u_{i}=b \sum_{i \in N}\left|u_{i}\right| \leqslant b \sum_{i \in N}|a|=-n a b
\tag{2}
$$
$$
\sum_{i \in N} u_{i}^{2} \leqslant \sum_{i \in N}|a| \cdot\left|u_{i}\right|=|a| \sum_{i \in N}\left|u_{i}\right|=|a| \sum_{i \in P} u_{i} \leqslant|a| \sum_{i \in P} b=-p a b .
\tag{3}
$$

The sum of these estimates is

$$
1=\sum_{i=1}^{2019} u_{i}^{2}=\sum_{i \in P} u_{i}^{2}+\sum_{i \in N} u_{i}^{2} \leqslant-(p+n) a b=-2019 a b
$$

that proves $a b \leqslant \frac{-1}{2019}$.
As in the previous solution we conclude that $a<0$ and $b>0$.

For every index $i$, the number $u_{i}$ is a convex combination of $a$ and $b$, so

$$
u_{i}=x_{i} a+y_{i} b \quad \text { with some weights } 0 \leqslant x_{i}, y_{i} \leqslant 1 \text {, with } x_{i}+y_{i}=1 \text {. }
$$

Let $X=\sum_{i=1}^{2019} x_{i}$ and $Y=\sum_{i=1}^{2019} y_{i}$. From $0=\sum_{i=1}^{2019} u_{i}=\sum_{i=1}^{2019}\left(x_{i} a+y_{i} b\right)=-|a| X+b Y$, we get

$$
|a| X=b Y
\tag{4}
$$



From $\sum_{i=1}^{2019}\left(x_{i}+y_{i}\right)=2019$ we have

$$
X+Y=2019
\tag{5}
$$

The system of linear equations $(4,5)$ has a unique solution:

$$
X=\frac{2019 b}{|a|+b}, \quad Y=\frac{2019|a|}{|a|+b}
$$

Now apply the following estimate to every $u_{i}^{2}$ in their sum:

$$
u_{i}^{2}=x_{i}^{2} a^{2}+2 x_{i} y_{i} a b+y_{i}^{2} b^{2} \leqslant x_{i} a^{2}+y_{i} b^{2}
$$

we obtain that

$$
1=\sum_{i=1}^{2019} u_{i}^{2} \leqslant \sum_{i=1}^{2019}\left(x_{i} a^{2}+y_{i} b^{2}\right)=X a^{2}+Y b^{2}=\frac{2019 b}{|a|+b}|a|^{2}+\frac{2019|a|}{|a|+b} b^{2}=2019|a| b=-2019 a b
$$

Hence, $a b \leqslant \frac{-1}{2019}$.