## NシNO The 12th Middle European Mathematical Olympiad ## Problems ## with Solutions The Problem Selection Committee The Jury and the Problem Selection Committee selected 12 problems proposed by the following countries: | | | T-1 | Poland | | :--- | :--- | :--- | :--- | | I-1 | Austria | T-2 | Austria | | I-2 | Ukraine | T-3 | Czech Republic | | I-3 | Slovakia | T-4 | Poland | | I-4 | Slovakia | T-5 | Slovakia | | | T-6 | Ukraine | | | | T-7 | Poland | | | | T-8 | Germany | | The Problem Selection Committee would like to thank Roger Labahn for providing the $\mathrm{IATEX}_{\mathrm{E}}$ templates. ## Contents Individual competition - problem statements ..... 4 [-1] ..... 4 I-2 ..... 4 I-3 ..... 4 I-4 ..... 4 Team competition - problem statements ..... 5 T-1 ..... 5 T-2 ..... 5 T-3 ..... 5 T-4 ..... 5 T-5 ..... 5 T-6 ..... 5 T-7. ..... 6 T-8 ..... 6 Individual competition - solutions ..... 7 [-1] ..... 7 I-2 ..... 8 I-3 ..... 9 I-4 ..... 11 Team competition - solutions ..... 12 T-1 ..... 12 T-2 ..... 13 T-3 ..... 15 T-4 ..... 16 T-5 ..... 17 T-6 ..... 19 T-7 ..... 21 T-8 ..... 22 ## I-1 Let $\mathbb{Q}^{+}$denote the set of all positive rational numbers and let $\alpha \in \mathbb{Q}^{+}$. Determine all functions $f: \mathbb{Q}^{+} \rightarrow(\alpha,+\infty)$ satisfying $$ f\left(\frac{x+y}{\alpha}\right)=\frac{f(x)+f(y)}{\alpha}, \quad \text { for all } x, y \in \mathbb{Q}^{+} . $$ ## I-2 The two figures depicted below consisting of 6 and 10 unit squares, respectively, are called staircases. ![](https://cdn.mathpix.com/cropped/2024_12_27_f0e30d0409ec4fd9b0e5g-04.jpg?height=226&width=720&top_left_y=938&top_left_x=673) Consider a $2018 \times 2018$ board consisting of $2018^{2}$ cells, each being a unit square. Two arbitrary cells were removed from the same row of the board. Prove that the rest of the board cannot be cut (along the cell borders) into staircases (possibly rotated). ## I-3 Let $A B C$ be an acute-angled triangle with $A B0$ and $B \geq 2$ or $A=0$ and $B>2$. For $\alpha \neq 2$ there are no solutions. Solution. By putting $x=y$ in the given functional equation we get $f\left(\frac{2 x}{\alpha}\right)=f(x) \cdot \frac{2}{\alpha}$. It follows that $$ t \in \operatorname{Im}(f) \Longleftrightarrow t \cdot \frac{2}{\alpha} \in \operatorname{Im}(f) \quad \text { for all } t \in \mathbb{Q}^{+} . $$ Therefore, if $\alpha \neq 2$ then $f$ takes arbitrarily small values. This is a contradiction with the assumption that $f(x)>\alpha$ for all $x \in \mathbb{Q}^{+}$. We conclude that there are no such functions for $\alpha \neq 2$. Assume now that $\alpha=2$. By putting $x=a+b$ and $y=a-b$ in the given functional equation, where $a>b>0$ are any rationals, we get $$ f(a+b)-f(a)=f(a)-f(a-b) $$ It follows that $f$ restricted to any arithmetic sequence is linear. Since for every rational number $q$ there is an arithmetic sequence containing $q$, 1 , and 2 , it follows that $f$ is linear on $\mathbb{Q}^{+}$. Therefore $f(x)=A x+B$ for some reals $A$ and $B$. A direct check of the condition $f(x)>2$ for all $x \in \mathbb{Q}^{+}$yields that it must be that either $A>0$ and $B \geq 2$ or $A=0$ and $B>2$. Clearly, all such functions satisfy the given equation. ## I-2 The two figures depicted below consisting of 6 and 10 unit squares, respectively, are called staircases. ![](https://cdn.mathpix.com/cropped/2024_12_27_f0e30d0409ec4fd9b0e5g-08.jpg?height=223&width=712&top_left_y=434&top_left_x=675) Consider a $2018 \times 2018$ board consisting of $2018^{2}$ cells, each being a unit square. Two arbitrary cells were removed from the same row of the board. Prove that the rest of the board cannot be cut (along the cell borders) into staircases (possibly rotated). Solution. Enumerate the rows of the board with integers from 1 to 2018. We color the cells of the board in horizontal strips of width 2 as follows: rows 1 and 2 are colored red, rows 3 and 4 are colored blue, rows 5 and 6 are colored red, rows 7 and 8 are colored blue, etc. If we disregarded the two cells removed from the board, both the number of red cells and the number of blue cells would be divisible by 4 . Since the two cells are removed from the same row, they would have the same color, hence after the removal we have that either the number of red cells is divisible by 4 , while the number of blue cells is congruent to 2 modulo 4 , or vice versa. In both cases, the numbers of red cells and of blue cells are not congruent modulo 4. ![](https://cdn.mathpix.com/cropped/2024_12_27_f0e30d0409ec4fd9b0e5g-08.jpg?height=501&width=1332&top_left_y=1617&top_left_x=365) It now remains to observe that if a staircase, either of size 6 or 10, is placed on the board, then the difference of the numbers of red and blue cells covered by the staircase is always divisible by 4. This follows from a straightforward case study. Hence, if the board with the two cells removed could be tiled with staircases, then the difference of the numbers of red and blue cells would be divisible by 4 , a contradiction. ## I-3 Let $A B C$ be an acute-angled triangle with $A Bm$. Thus the least $n$ that satisfies these conditions is $\operatorname{lcm}(1,2, \ldots, m)-1$. It follows that $p(m)=\operatorname{lcm}(1,2, \ldots, m)-1$ for every integer $m \geq 3$. In particular, a number $n$ as in statement a) always exists. To finish the problem we need to prove that $\operatorname{lcm}(1,2, \ldots, 2018)=\operatorname{lcm}(1,2, \ldots, 2019)$. But this is clear, because $2019=3 \cdot 673 \mid \operatorname{lcm}(1,2, \ldots, 2018)$, so we are done. ## T-1 Let $a, b$ and $c$ be positive real numbers satisfying $a b c=1$. Prove that $$ \frac{a^{2}-b^{2}}{a+b c}+\frac{b^{2}-c^{2}}{b+c a}+\frac{c^{2}-a^{2}}{c+a b} \leq a+b+c-3 $$ Solution. Note that $$ \frac{a^{2}-b^{2}}{a+b c}=\frac{a(a+b c)-a b c-b^{2}}{a+b c}=a-\frac{b^{2}+1}{a+b c}=a-a \cdot \frac{b^{2}+1}{a^{2}+a b c}=a-a \cdot \frac{b^{2}+1}{a^{2}+1} . $$ Therefore the desired inequality can be rewritten as $$ a-a \cdot \frac{b^{2}+1}{a^{2}+1}+b-b \cdot \frac{c^{2}+1}{b^{2}+1}+c-c \cdot \frac{a^{2}+1}{c^{2}+1} \leq a+b+c-3 $$ or $$ 3 \leq a \cdot \frac{b^{2}+1}{a^{2}+1}+b \cdot \frac{c^{2}+1}{b^{2}+1}+c \cdot \frac{a^{2}+1}{c^{2}+1} . $$ This immediately follows from AM-GM inequality. The proof is completed. ## T-2 Let $P(x)$ be a polynomial of degree $n \geq 2$ with rational coefficients such that $P(x)$ has $n$ pairwise different real roots forming an arithmetic progression. Prove that among the roots of $P(x)$ there are two that are also the roots of some polynomial of degree 2 with rational coefficients. Solution. Let $$ P(x)=x^{n}+a_{n-1} x^{n-1}+\ldots+a_{1} x+a_{0} . $$ Then the polynomial $P$ has $n$ distinct real roots $r_{1}0$. Denoting $k=\frac{n-1}{2}$, again by Viète's formula we infer that $$ a_{n-2}=\sum_{-k \leq i0$. Denoting $k=\frac{n}{2}$, by Viète's formula we infer that $$ a_{n-2}=\sum_{-k0$ one has $c=a^{2}-a+1>0, k=\left(a^{2}-a+2\right)^{2}-2>0$, and $b=k(a+c)+a-1>0$. These numbers satisfy $$ \frac{a^{2}+b^{2}+c^{2}}{a b+b c+c a}=k $$ and witness that $k=\left(a^{2}-a+2\right)^{2}-2 \in S$ for every positive integer $a$. Solution 2. to a) To prove that $k \in S$ we have to find positive integers $a, b, c$ satisfying $$ k \cdot(a b+b c+c a)=a^{2}+b^{2}+c^{2} $$ Set $a=k \cdot(b+c)+x$ for some positive integer $x$. Then the above becomes equivalent to: $$ \begin{aligned} k \cdot((k \cdot(b+c)+x) \cdot(b+c)+b c) & =(k \cdot(b+c)+x)^{2}+b^{2}+c^{2} \\ k^{2} \cdot(b+c)^{2}+k x \cdot(b+c)+k b c & =k^{2} \cdot(b+c)^{2}+2 k x \cdot(b+c)+x^{2}+b^{2}+c^{2} \\ k b c-k x \cdot(b+c) & =x^{2}+b^{2}+c^{2} \\ k \cdot(b c-b x-c x) & =x^{2}+b^{2}+c^{2} \end{aligned} $$ This can be trivially satisfied, if we find positive integers $b, c, x$ with $b c-b x-c x=1$. Or equivalently: $$ b=\frac{c x+1}{c-x} $$ This shows that for any positive integer $x$ the following integers satisfy ( $*$ ): $$ \begin{aligned} & c=x+1 \\ & b=c x+1=x^{2}+x+1 \\ & k=x^{2}+b^{2}+c^{2}=x^{4}+2 x^{3}+5 x^{2}+4 x+2 \\ & a=k(b+c)+x=x^{6}+4 x^{5}+11 x^{4}+18 x^{3}+20 x^{2}+13 x+4 \end{aligned} $$ In particular, any integer of the form $x^{4}+2 x^{3}+5 x^{2}+4 x+2$ is an element of $S$. As this grows strictly monotonically with $x$, we get infinitely many possible positive integer values in $S$. Solution 3. to a) Let $m$ be an odd positive number and let $a=F_{m}, b=F_{m+1}$, where $F_{i}$ denotes the $i$-th Fibonacci number. Moreover, let $$ c=\frac{\left(a^{2}+a b+b^{2}\right)^{2}-a b}{a+b}=a^{3}+a^{2} b+a b^{2}+b^{3}+a b \cdot \frac{a b-1}{a+b} . $$ In order to prove that $c$ is an integer we will first prove the following identity: $$ F_{k+1}^{2}-F_{k}^{2}=F_{k} F_{k+1}+(-1)^{k} $$ for all integers $k \geq 1$. Recall that $F_{i}=\frac{\xi^{i}-\eta^{i}}{\xi-\eta}$, where $\xi$ and $\eta$ are the roots of the quadratic polynomial $t^{2}-t-1$. Then $\xi \eta=-1$. Therefore $$ \begin{aligned} F_{k+1}^{2}-F_{k}^{2}-F_{k} F_{k+1} & =F_{k+1}\left(F_{k+1}-F_{k}\right)-F_{k}^{2}=F_{k+1} F_{k-1}-F_{k}^{2} \\ & =\frac{\xi^{k+1}-\eta^{k+1}}{\xi-\eta} \cdot \frac{\xi^{k-1}-\eta^{k-1}}{\xi-\eta}-\left(\frac{\xi^{k}-\eta^{k}}{\xi-\eta}\right)^{2} \\ & =\frac{\xi^{2 k}+\eta^{2 k}-\xi^{k+1} \eta^{k-1}-\xi^{k-1} \eta^{k+1}-\left(\xi^{2 k}+\eta^{2 k}-2 \xi^{k} \eta^{k}\right)}{(\xi-\eta)^{2}} \\ & =\frac{-\xi^{k-1} \eta^{k-1}\left(\xi^{2}+\eta^{2}-2 \xi \eta\right)}{(\xi-\eta)^{2}}=\frac{(-1)^{k}(\xi-\eta)^{2}}{(\xi-\eta)^{2}}=(-1)^{k} . \end{aligned} $$ Since $m$ is odd we have $$ (b-a)(b+a)=b^{2}-a^{2}=a b-1, $$ therefore $a+b \mid a b-1$ which means that $c$ is indeed an integer. Now, observe that $$ a b+b c+c a=a b+c(a+b)=\left(a^{2}+a b+b^{2}\right)^{2} . $$ As a consequence, $$ \begin{aligned} \left(a^{2}+b^{2}+c^{2}\right)(a+b)^{2} & =\left(a^{2}+b^{2}\right)(a+b)^{2}+(c(a+b))^{2} \equiv\left(a^{2}+b^{2}\right)^{2}+2\left(a^{2}+b^{2}\right) \cdot a b+(a b)^{2} \\ & =\left(a^{2}+a b+b^{2}\right)^{2} \equiv 0 \quad(\bmod a b+b c+c a) . \end{aligned} $$ But since $\operatorname{gcd}(a, b)=\operatorname{gcd}\left(F_{m}, F_{m+1}\right)=1$, then also $$ \operatorname{gcd}(a+b, a b+b c+c a)=\operatorname{gcd}(a+b, a b)=1 $$ Therefore we obtain that $\frac{a^{2}+b^{2}+c^{2}}{a b+b c+c a}$ is an integer. To end the proof it suffices to show that $\frac{a^{2}+b^{2}+c^{2}}{a b+b c+c a}$ can be arbitrarily large, depending on the choice of $m$. But $$ \begin{gathered} a^{2}+b^{2}+c^{2} \geq c^{2} \geq b^{6} \quad \text { and } \\ a b+b c+c a=\left(a^{2}+a b+b^{2}\right)^{2} \leq 9 b^{4} \end{gathered} $$ which means that $\frac{a^{2}+b^{2}+c^{2}}{a b+b c+c a} \geq \frac{b^{2}}{9}$. Since $b=F_{m+1}$ can be arbitrarily large, the conclusion follows. Solution 1. to b) We will show that $4 \notin S$. It is enough to prove that the equation $$ a^{2}+b^{2}+c^{2}=4(a b+b c+c a) $$ has no solutions in positive integers. Since squares of integers may be congruent only to 0 or 1 modulo 4 , while the right hand side is divisible by 4 , we have $a^{2} \equiv b^{2} \equiv c^{2} \equiv 0(\bmod 4)$. Therefore $a=2 a_{1}, b=2 b_{1}, c=2 c_{1}$ for some positive integers $a_{1}, b_{1}, c_{1}$. Then $$ a_{1}^{2}+b_{1}^{2}+c_{1}^{2}=4\left(a_{1} b_{1}+b_{1} c_{1}+c_{1} a_{1}\right) . $$ By continuing this process we see that $a, b, c$ are divisible by $2^{k}$ for every positive integer $k$, which is a contradiction. Comment. One can prove in a similar way that $4 n \notin S$ for every integer $n$. Solution 2. to b) We will prove that $3 \notin S$. We have to show that there are no positive integers $a, b, c$ satisfying $$ a^{2}+b^{2}+c^{2}=3(a b+b c+c a) $$ Suppose the contrary and let $a, b, c$ be a solution to the above that minimizes $a+b+c$. Then at least one of $a, b, c$ is odd because otherwise $a / 2, b / 2, c / 2$ is a solution with a smaller sum of variables. We rewrite the equation in the following form: $$ (a+b)^{2}+(b+c)^{2}+(c+a)^{2}=8(a b+b c+c a) . $$ Since squares of integers may be congruent only to 0 or 1 modulo 4 , we see that $(a+b)^{2} \equiv$ $(b+c)^{2} \equiv(c+a)^{2}(\bmod 4)$. It follows that $a, b, c$ have the same parity. Since one of $a, b, c$ is odd, actually all of them are odd. Write $a=2 k+1, b=2 l+1, c=2 m+1$. Substituting this to the original equation yields $$ 4\left(k^{2}+k+l^{2}+l+m^{2}+m\right)+3=12(k l+l m+m k+k+l+m)+9 . $$ It follows that $3 \equiv 9(\bmod 4)$ which is absurd. Therefore, there are no positive integers $a, b, c$ satisfying $a^{2}+b^{2}+c^{2}=3(a b+b c+c a)$. Comment. One can prove in a similar way that $4 n+3 \notin S$ for every integer $n$. Solution 3. to b) Before we start the actual proof, let us give some preparatory statements. First, we may assume without loss of generality that $\operatorname{gcd}(a, b, c)=1$, as otherwise we can simply divide all of $a, b, c$ by $\operatorname{gcd}(a, b, c)$. Next, we claim that $\operatorname{gcd}(a, b)=1$. Otherwise, the denominator would be divisible by $\operatorname{gcd}(a, b)$, so the numerator would have to be divisible by $\operatorname{gcd}(a, b)$ as well, which would entail $\operatorname{gcd}(a, b) \mid c$. But this contradicts $\operatorname{gcd}(a, b, c)=1$. We now move to the main problem: we claim that $3 \notin S$. In other words, we have to prove that the equation $$ a^{2}+b^{2}+c^{2}=3 a b+3 b c+3 c a $$ has no solutions in positive integers. Regrouping the terms yields $$ c^{2}-(3 a+3 b) c+a^{2}-3 a b+b^{2}=0 $$ which we now consider as a quadratic equation in $c$. For $c$ to be an integer, it is necessary that the discriminant, written below, is a perfect square: $$ \Delta=9(a+b)^{2}-4\left(a^{2}-3 a b+b^{2}\right)=5\left(a^{2}+6 a b+b^{2}\right) $$ This implies that $a^{2}+6 a b+b^{2}=(a+3 b)^{2}-8 b^{2}$ is divisible by 5 . However, $(a+3 b)^{2}$ may be congruent only to 0,1 , or 4 modulo 5 , whereas $8 b^{2}$ may be congruent only to 0,2 , or 3 modulo 5 , so their difference can only be divisible by 5 only if $b \equiv 0(\bmod 5)$ and $a+3 b \equiv 0(\bmod 5)$. This however implies $5 \mid \operatorname{gcd}(a, b)=1$, which is a contradiction. Comment. That $4 \notin S$ can be proved in a very similar fashion. Comment. A (non-exhaustive) computer search found the following integer values smaller than 200 in $S$ : $$ \begin{aligned} & 1,2,5,10,14,17,26,29,37,50,62,65,74,77,82,98,101,109,110, \\ & 122,125,145,149,170,173,190,194,197 \end{aligned} $$ Comment. There are several other families of solutions that can be used for part a). Probably the simplest (though maybe not to find...) is $$ \begin{aligned} & a=x+1 \\ & b=x^{2}+1 \\ & c=x^{4}+x^{3}+3 x^{2}+2 x+1 \\ & n=x^{2}+1 . \end{aligned} $$