15. A1 (CZE) Find all functions $f$ from the reals to the reals such that  $$ f(f(x)+y)=2 x+f(f(y)-x) $$  for all real $x, y$.

Solution: 15. We observe first that $f$ is surjective. Indeed, setting $y=-f(x)$ gives $f(f(-f(x))-x)=f(0)-2 x$, where the right-hand expression can take any real value. In particular, there exists $x_{0}$ for which $f\left(x_{0}\right)=0$. Now setting $x=x_{0}$ in the functional equation yields $f(y)=2 x_{0}+f\left(f(y)-x_{0}\right)$, so we obtain  $$ f(z)=z-x_{0} \quad \text { for } z=f(y)-x_{0} $$  Since $f$ is surjective, $z$ takes all real values. Hence for all $z, f(z)=z+c$ for some constant $c$, and this is indeed a solution.


16. A2 (YUG) Let $a_{1}, a_{2}, \ldots$ be an infinite sequence of real numbers for which there exists a real number $c$ with $0 \leq a_{i} \leq c$ for all $i$ such that  $$ \left|a_{i}-a_{j}\right| \geq \frac{1}{i+j} \quad \text { for all } i, j \text { with } i \neq j $$  Prove that $c \geq 1$.

Solution: 16. For $n \geq 2$, let $\left(k_{1}, k_{2}, \ldots, k_{n}\right)$ be the permutation of $\{1,2, \ldots, n\}$ with $a_{k_{1}} \leq a_{k_{2}} \leq \cdots \leq a_{k_{n}}$. Then from the condition of the problem, using the Cauchy-Schwarz inequality, we obtain  $$ \begin{aligned} c & \geq a_{k_{n}}-a_{k_{1}}=\left|a_{k_{n}}-a_{k_{n-1}}\right|+\cdots+\left|a_{k_{3}}-a_{k_{2}}\right|+\left|a_{k_{2}}-a_{k_{1}}\right| \\ & \geq \frac{1}{k_{1}+k_{2}}+\frac{1}{k_{2}+k_{3}}+\cdots+\frac{1}{k_{n-1}+k_{n}} \\ & \geq \frac{(n-1)^{2}}{\left(k_{1}+k_{2}\right)+\left(k_{2}+k_{3}\right)+\cdots+\left(k_{n-1}+k_{n}\right)} \\ & =\frac{(n-1)^{2}}{2\left(k_{1}+k_{2}+\cdots+k_{n}\right)-k_{1}-k_{n}} \geq \frac{(n-1)^{2}}{n^{2}+n-3} \geq \frac{n-1}{n+2} . \end{aligned} $$  Therefore $c \geq 1-\frac{3}{n+2}$ for every positive integer $n$. But if $c<1$, this inequality is obviously false for all $n>\frac{3}{1-c}-2$. We conclude that $c \geq 1$. Remark. The least value of $c$ is not greater than $2 \ln 2$. An example of a sequence $\left\{a_{n}\right\}$ with $0 \leq a_{n} \leq 2 \ln 2$ can be constructed inductively as follows: Given $a_{1}, a_{2}, \ldots, a_{n-1}$, then $a_{n}$ can be any number from $[0,2 \ln 2]$ that does not belong to any of the intervals $\left(a_{i}-\frac{1}{i+n}, a_{i}+\frac{1}{i+n}\right)(i=$ $1,2, \ldots, n-1)$, and the total length of these intervals is always less than or equal to  $$ \frac{2}{n+1}+\frac{2}{n+2}+\cdots+\frac{2}{2 n-1}<2 \ln 2 $$


17. A3 (POL) Let $P$ be a cubic polynomial given by $P(x)=a x^{3}+b x^{2}+c x+$ $d$, where $a, b, c, d$ are integers and $a \neq 0$. Suppose that $x P(x)=y P(y)$ for infinitely many pairs $x, y$ of integers with $x \neq y$. Prove that the equation $P(x)=0$ has an integer root.

Solution: 17. Let $x, y$ be distinct integers satisfying $x P(x)=y P(y)$; this is equivalent to $a\left(x^{4}-y^{4}\right)+b\left(x^{3}-y^{3}\right)+c\left(x^{2}-y^{2}\right)+d(x-y)=0$. Dividing by $x-y$ we obtain  $$ a\left(x^{3}+x^{2} y+x y^{2}+y^{3}\right)+b\left(x^{2}+x y+y^{2}\right)+c(x+y)+d=0 . $$  Putting $x+y=p, x^{2}+y^{2}=q$ leads to $x^{2}+x y+y^{2}=\frac{p^{2}+q}{2}$, so the above equality becomes  $$ a p q+\frac{b}{2}\left(p^{2}+q\right)+c p+d=0, \quad \text { i.e. } \quad(2 a p+b) q=-\left(b p^{2}+2 c p+2 d\right) $$  Since $q \geq p^{2} / 2$, it follows that $p^{2}|2 a p+b| \leq 2\left|b p^{2}+2 c p+2 d\right|$, which is possible only for finitely many values of $p$, although there are infinitely many pairs $(x, y)$ with $x P(x)=y P(y)$. Hence there exists $p$ such that $x P(x)=(p-x) P(p-x)$ for infinitely many $x$, and therefore for all $x$. If $p \neq 0$, then $p$ is a root of $P(x)$. If $p=0$, the above relation gives $P(x)=-P(-x)$. This forces $b=d=0$, so $P(x)=x\left(a x^{2}+c\right)$. Thus 0 is a root of $P(x)$.


18. A4 (IND) ${ }^{\text {IMO5 }}$ Find all functions $f$ from the reals to the reals such that  $$ (f(x)+f(z))(f(y)+f(t))=f(x y-z t)+f(x t+y z) $$  for all real $x, y, z, t$.

Solution: 18. Putting $x=z=0$ and $t=y$ into the given equation gives $4 f(0) f(y)=$ $2 f(0)$ for all $y$. If $f(0) \neq 0$, then we deduce $f(y)=\frac{1}{2}$, i.e., $f$ is identically equal to $\frac{1}{2}$. Now we suppose that $f(0)=0$. Setting $z=t=0$ we obtain  $$ f(x y)=f(x) f(y) \quad \text { for all } x, y \in \mathbb{R} $$  Thus if $f(y)=0$ for some $y \neq 0$, then $f$ is identically zero. So, assume $f(y) \neq 0$ whenever $y \neq 0$.  Next, we observe that $f$ is strictly increasing on the set of positive reals. Actually, it follows from (1) that $f(x)=f(\sqrt{x})^{2} \geq 0$ for all $x \geq 0$, so that the given equation for $t=x$ and $z=y$ yields $f\left(x^{2}+y^{2}\right)=(f(x)+f(y))^{2} \geq$ $f\left(x^{2}\right)$ for all $x, y \geq 0$. Using (1) it is easy to get $f(1)=1$. Now plugging $t=y$ into the given equation, we are led to  $$ 2[f(x)+f(z)]=f(x-z)+f(x+z) \quad \text { for all } x, z $$  In particular, $f(z)=f(-z)$. Further, it is easy to get by induction from (2) that $f(n x)=n^{2} f(x)$ for all integers $n$ (and consequently for all rational numbers as well). Therefore $f(q)=f(-q)=q^{2}$ for all $q \in \mathbb{Q}$. But $f$ is increasing for $x>0$, so we must have $f(x)=x^{2}$ for all $x$. It is easy to verify that $f(x)=0, f(x)=\frac{1}{2}$ and $f(x)=x^{2}$ are indeed solutions.


19. A5 (IND) Let $n$ be a positive integer that is not a perfect cube. Define real numbers $a, b, c$ by  $$ a=\sqrt[3]{n}, \quad b=\frac{1}{a-[a]}, \quad c=\frac{1}{b-[b]}, $$  where $[x]$ denotes the integer part of $x$. Prove that there are infinitely many such integers $n$ with the property that there exist integers $r, s, t$, not all zero, such that $r a+s b+t c=0$.

Solution: 19. Write $m=[\sqrt[3]{n}]$. To simplify the calculation, we shall assume that $[b]=1$. Then $a=\sqrt[3]{n}, b=\frac{1}{\sqrt[3]{n}-m}=\frac{1}{n-m^{3}}\left(m^{2}+m \sqrt[3]{n}+\sqrt[3]{n^{2}}\right), c=\frac{1}{b-1}=$ $u+v \sqrt[3]{n}+w \sqrt[3]{n^{2}}$ for certain rational numbers $u, v, w$. Obviously, integers $r, s, t$ with $r a+s b+t c=0$ exist if (and only if) $u=m^{2} w$, i.e., if ( $b-$ 1) $\left(m^{2} w+v \sqrt[3]{n}+w \sqrt[3]{n^{2}}\right)=1$ for some rational $v, w$.  When the last equality is expanded and simplified, comparing the coefficients at $1, \sqrt[3]{n}, \sqrt[3]{n^{2}}$ one obtains  $$ \begin{array}{rlrl} 1: & v+\left(\left(m^{2}+m^{3}-n\right) m^{2}+m\right) w & =n-m^{3}, \\ \sqrt[3]{n}: & \left(m^{2}+m^{3}-n\right) v+ & \left(m^{3}+n\right) w & =0, \\ \sqrt[3]{n^{2}}: & m v+ & \left(2 m^{2}+m^{3}-n\right) w & =0 . \end{array} $$  In order for the system (1) to have a solution $v, w$, we must have $\left(2 m^{2}+\right.$ $\left.m^{3}-n\right)\left(m^{2}+m^{3}-n\right)=m\left(m^{3}+n\right)$. This quadratic equation has solutions $n=m^{3}$ and $n=m^{3}+3 m^{2}+m$. The former is not possible, but the latter gives $a-[a]>\frac{1}{2}$, so $[b]=1$, and the system (1) in $v, w$ is solvable. Hence every number $n=m^{3}+3 m^{2}+m, m \in \mathbb{N}$, satisfies the condition of the problem.


2. N2 (ROM) ${ }^{\mathrm{IMO} 4}$ Let $n \geq 2$ be a positive integer, with divisors $1=d_{1}<$ $d_{2}<\cdots<d_{k}=n$. Prove that $d_{1} d_{2}+d_{2} d_{3}+\cdots+d_{k-1} d_{k}$ is always less than $n^{2}$, and determine when it is a divisor of $n^{2}$.

Solution: 2. Set $S=d_{1} d_{2}+\cdots+d_{k-1} d_{k}$. Since $d_{i} / n=1 / d_{k+1-i}$, we have $\frac{S}{n^{2}}=$ $\frac{1}{d_{k} d_{k-1}}+\cdots+\frac{1}{d_{2} d_{1}}$. Hence  $$ \frac{1}{d_{2} d_{1}} \leq \frac{S}{n^{2}} \leq\left(\frac{1}{d_{k-1}}-\frac{1}{d_{k}}\right)+\cdots+\left(\frac{1}{d_{1}}-\frac{1}{d_{2}}\right)=1-\frac{1}{d_{k}}<1 $$  or $\left(\right.$ since $\left.d_{1}=1\right) 1<\frac{n^{2}}{S} \leq d_{2}$. This shows that $S<n^{2}$. Also, if $S$ is a divisor of $n^{2}$, then $n^{2} / S$ is a nontrivial divisor of $n^{2}$ not exceeding $d_{2}$. But $d_{2}$ is obviously the least prime divisor of $n$ (and also of $n^{2}$ ), so we must have $n^{2} / S=d_{2}$, which holds if and only if $n$ is prime.


20. A6 (IRN) Let $A$ be a nonempty set of positive integers. Suppose that there are positive integers $b_{1}, \ldots, b_{n}$ and $c_{1}, \ldots, c_{n}$ such that (i) for each $i$ the set $b_{i} A+c_{i}=\left\{b_{i} a+c_{i} \mid a \in A\right\}$ is a subset of $A$, and (ii) the sets $b_{i} A+c_{i}$ and $b_{j} A+c_{j}$ are disjoint whenever $i \neq j$.  Prove that  $$ \frac{1}{b_{1}}+\cdots+\frac{1}{b_{n}} \leq 1 $$

Solution: 20. Assume to the contrary that $\frac{1}{b_{1}}+\cdots+\frac{1}{b_{n}}>1$. Certainly $n \geq 2$ and $A$ is infinite. Define $f_{i}: A \rightarrow A$ as $f_{i}(x)=b_{i} x+c_{i}$ for each $i$. By condition (ii), $f_{i}(x)=f_{j}(y)$ implies $i=j$ and $x=y$; iterating this argument, we deduce that $f_{i_{1}}\left(\ldots f_{i_{m}}(x) \ldots\right)=f_{j_{1}}\left(\ldots f_{j_{m}}(x) \ldots\right)$ implies $i_{1}=j_{1}, \ldots, i_{m}=j_{m}$ and $x=y$. As an illustration, we shall consider the case $b_{1}=b_{2}=b_{3}=2$ first. If $a$ is large enough, then for any $i_{1}, \ldots, i_{m} \in\{1,2,3\}$ we have $f_{i_{1}} \circ \cdots \circ f_{i_{m}}(a) \leq$ $2.1^{m} a$. However, we obtain $3^{m}$ values in this way, so they cannot be all distinct if $m$ is sufficiently large, a contradiction. In the general case, let real numbers $d_{i}>b_{i}, i=1,2 \ldots, n$, be chosen such that $\frac{1}{d_{1}}+\cdots+\frac{1}{d_{n}}>1$ : for $a$ large enough, $f_{i}(x)<d_{i} a$ for each $x \geq a$.  Also, let $k_{i}>0$ be arbitrary rational numbers with sum 1 ; denote by $N_{0}$ the least common multiple of their denominators. Let $N$ be a fixed multiple of $N_{0}$, so that each $k_{j} N$ is an integer. Consider all combinations $f_{i_{1}} \circ \cdots \circ f_{i_{N}}$ of $N$ functions, among which each $f_{i}$ appears exactly $k_{i} N$ times. There are $F_{N}=\frac{N!}{\left(k_{1} N\right)!\cdots\left(k_{n} N\right)!}$ such combinations, so they give $F_{N}$ distinct values when applied to $a$. On the other hand, $f_{i_{1}} \circ \cdots \circ f_{i_{N}}(a) \leq\left(d_{1}^{k_{1}} \cdots d_{n}^{k_{n}}\right)^{N} a$. Therefore  $$ \left(d_{1}^{k_{1}} \cdots d_{n}^{k_{n}}\right)^{N} a \geq F_{N} \quad \text { for all } N, N_{0} \mid N $$  It remains to find a lower estimate for $F_{N}$. In fact, it is straightforward to verify that $F_{N+N_{0}} / F_{N}$ tends to $Q^{N_{0}}$, where $Q=1 /\left(k_{1}^{k_{1}} \cdots k_{n}^{k_{n}}\right)$. Consequently, for every $q<Q$ there exists $p>0$ such that $F_{N}>p q^{N}$. Then (1) implies that  $$ \left(\frac{d_{1}^{k_{1}} \cdots d_{n}^{k_{n}}}{q}\right)^{N}>\frac{p}{a} \text { for every multiple } N \text { of } N_{0} $$  and hence $d_{1}^{k_{1}} \cdots d_{n}^{k_{n}} / q \geq 1$. This must hold for every $q<Q$, and so we have $d_{1}^{k_{1}} \cdots d_{n}^{k_{n}} \geq Q$, i.e.,  $$ \left(k_{1} d_{1}\right)^{k_{1}} \cdots\left(k_{n} d_{n}\right)^{k_{n}} \geq 1 $$  However, if we choose $k_{1}, \ldots, k_{n}$ such that $k_{1} d_{1}=\cdots=k_{n} d_{n}=u$, then we must have $u \geq 1$. Therefore $\frac{1}{d_{1}}+\cdots+\frac{1}{d_{n}} \leq k_{1}+\cdots+k_{n}=1$, a contradiction.


21. $\mathbf{C 1}(\mathbf{C O L})^{\mathrm{IMO} 1}$ Let $n$ be a positive integer. Each point $(x, y)$ in the plane, where $x$ and $y$ are nonnegative integers with $x+y \leq n$, is colored red or blue, subject to the following condition: If a point $(x, y)$ is red, then so are all points $\left(x^{\prime}, y^{\prime}\right)$ with $x^{\prime} \leq x$ and $y^{\prime} \leq y$. Let $A$ be the number of ways to choose $n$ blue points with distinct $x$-coordinates, and let $B$ be the number of ways to choose $n$ blue points with distinct $y$-coordinates. Prove that $A=B$.

Solution: 21. Let $a_{i}$ be the number of blue points with $x$-coordinate $i$, and $b_{i}$ the number of blue points with $y$-coordinate $i$. Our task is to show that $a_{0} a_{1} \cdots a_{n-1}=$ $b_{0} b_{1} \cdots b_{n-1}$. Moreover, we claim that $a_{0}, \ldots, a_{n-1}$ is a permutation of $b_{0}, \ldots, b_{n-1}$, and to show this we use induction on the number of red points. The result is trivial if all the points are blue. So, choose a red point $(x, y)$ with $x+y$ maximal: clearly $a_{x}=b_{y}=n-x-y-1$. If we change this point to blue, $a_{x}$ and $b_{y}$ will decrease by 1 . Then by the induction hypothesis, $a_{0}, \ldots, a_{n-1}$ with $a_{x}$ decreased by 1 is a permutation of $b_{0}, \ldots, b_{n-1}$ with $b_{y}$ decreased by 1 . However, $a_{x}=b_{y}$, and the claim follows. Remark. One can also use induction on $n$ : it is not more difficult.


22. C2 (ARM) For $n$ an odd positive integer, the unit squares of an $n \times n$ chessboard are colored alternately black and white, with the four corners colored black. A tromino is an $L$-shape formed by three connected unit squares. For which values of $n$ is it possible to cover all the black squares with nonoverlapping trominos? When it is possible, what is the minimum number of trominos needed?

Solution: 22. Write $n=2 k+1$. Consider the black squares at an odd height: there are $(k+1)^{2}$ of them in total and no two can be covered by one trimino. Thus, we always need at least $(k+1)^{2}$ triminoes, which cover $3(k+1)^{2}$ squares in total. However, $3(k+1)^{2}$ is greater than $n^{2}$ for $n=1,3,5$, so we must have $n \geq 7$. The case $n=7$ admits such a covering, as shown in Figure 1. For $n>7$ this is possible as well: it follows by induction from Figure 2. ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-707.jpg?height=186&width=195&top_left_y=302&top_left_x=402)  Fig. 1 ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-707.jpg?height=239&width=249&top_left_y=251&top_left_x=903)  Fig. 2


23. C3 (COL) Let $n$ be a positive integer. A sequence of $n$ positive integers (not necessarily distinct) is called full if it satisfies the following condition: For each positive integer $k \geq 2$, if the number $k$ appears in the sequence, then so does the number $k-1$, and moreover, the first occurrence of $k-1$ comes before the last occurrence of $k$. For each $n$, how many full sequences are there?

Solution: 23. We claim that there are $n$ ! full sequences. To show this, we construct a bijection with the set of permutations of $\{1,2, \ldots, n\}$. Consider a full sequence $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$, and let $m$ be the greatest of the numbers $a_{1}, \ldots, a_{n}$. Let $S_{k}, 1 \leq k \leq m$, be the set of those indices $i$ for which $a_{i}=k$. Then $S_{1}, \ldots S_{m}$ are nonempty and form a partition of the set $\{1,2, \ldots, n\}$. Now we write down the elements of $S_{1}$ in descending order, then the elements of $S_{2}$ in descending order and so on. This maps the full sequence to a permutation of $\{1,2, \ldots, n\}$. Moreover, this map is reversible, since each permutation uniquely breaks apart into decreasing sequences $S_{1}^{\prime}, S_{2}^{\prime}, \ldots, S_{m}^{\prime}$, so that $\max S_{i}^{\prime}>\min S_{i-1}^{\prime}$. Therefore the full sequences are in bijection with the permutations of $\{1,2, \ldots, n\}$. Second solution. Let there be given a full sequence of length $n$. Removing from it the first occurrence of the highest number, we obtain a full sequence of length $n-1$. On the other hand, each full sequence of length $n-1$ can be obtained from exactly $n$ full sequences of length $n$. Therefore, if $x_{n}$ is the number of full sequences of length $n$, we deduce $x_{n}=n x_{n-1}$.


24. C4 (BUL) Let $T$ be the set of ordered triples $(x, y, z)$, where $x, y, z$ are integers with $0 \leq x, y, z \leq 9$. Players $A$ and $B$ play the following guessing game: Player $A$ chooses a triple $(x, y, z)$ in $T$, and Player $B$ has to discover A's triple in as few moves as possible. A move consists of the following: $B$ gives $A$ a triple $(a, b, c)$ in $T$, and $A$ replies by giving $B$ the number $|x+y-a-b|+|y+z-b-c|+|z+x-c-a|$. Find the minimum number of moves that $B$ needs to be sure of determining $A$ 's triple.

Solution: 24. Two moves are not sufficient. Indeed, the answer to each move is an even number between 0 and 54 , so the answer takes at most 28 distinct values. Consequently, two moves give at most $28^{2}=784$ distinct outcomes, which is less than $10^{3}=1000$. We now show that three moves are sufficient. With the first move $(0,0,0)$, we get the reply $2(x+y+z)$, so we now know the value of $s=x+y+z$. Now there are several cases: (i) $s \leq 9$. Then we ask $(9,0,0)$ as the second move and get $(9-x-y)+$ $(9-x-z)+(y+z)=18-2 x$, so we come to know $x$. Asking $(0,9,0)$ we obtain $y$, which is enough, since $z=s-x-y$. (ii) $10 \leq s \leq 17$. In this case the second move is $(9, s-9,0)$. The answer is $z+(9-x)+|x+z-9|=2 k$, where $k=z$ if $x+z \geq 9$, or $k=9-x$ if $x+z<9$. In both cases we have $z \leq k \leq y+z \leq s$. Let $s-k \leq 9$. Then in the third move we ask $(s-k, 0, k)$ and obtain $|z-k|+|k-y-z|+y$, which is actually $(k-z)+(y+z-k)+y=2 y$. Thus we also find out $x+z$, and thus deduce whether $k$ is $z$ or $9-x$. Consequently we determine both $x$ and $z$. Let $s-k>9$. In this case, the third move is $(9, s-k-9, k)$. The answer is $|s-k-x-y|+|s-9-y-z|+|k+9-z-x|=$ $(k-z)+(9-x)+(9-x+k-z)=18+2 k-2(x+z)$, from which we find out again whether $k$ is $z$ or $9-x$. Now we are easily done. (iii) $18 \leq s \leq 27$. Then as in the first case, asking $(0,9,9)$ and $(9,0,9)$ we obtain $x$ and $y$.


25. C5 (BRA) Let $r \geq 2$ be a fixed positive integer, and let $\mathcal{F}$ be an infinite family of sets, each of size $r$, no two of which are disjoint. Prove that there exists a set of size $r-1$ that meets each set in $\mathcal{F}$.

Solution: 25. Assume to the contrary that no set of size less than $r$ meets all sets in $\mathcal{F}$. Consider any set $A$ of size less than $r$ that is contained in infinitely many sets of $\mathcal{F}$. By the assumption, $A$ is disjoint from some set $B \in \mathcal{F}$. Then of the infinitely many sets that contain $A$, each must meet $B$, so some element $b$ of $B$ belongs to infinitely many of them. But then the set $A \cup\{b\}$ is contained in infinitely many sets of $\mathcal{F}$ as well. Such a set $A$ exists: for example, the empty set. Now taking for $A$ the largest such set we come to a contradiction.


26. C6 (POL) Let $n$ be an even positive integer. Show that there is a permutation $x_{1}, x_{2}, \ldots, x_{n}$ of $1,2, \ldots, n$ such that for every $1 \leq i \leq n$ the number $x_{i+1}$ is one of $2 x_{i}, 2 x_{i}-1,2 x_{i}-n, 2 x_{i}-n-1$ (where we take $x_{n+1}=x_{1}$ ).

Solution: 26. Write $n=2 m$. We shall define a directed graph $G$ with vertices $1, \ldots, m$ and edges labelled $1,2, \ldots, 2 m$ in such a way that the edges issuing from $i$ are labelled $2 i-1$ and $2 i$, and those entering it are labelled $i$ and $i+m$. What we need is an Euler circuit in $G$, namely a closed path that passes each edge exactly once. Indeed, if $x_{i}$ is the $i$ th edge in such a circuit, then $x_{i}$ enters some vertex $j$ and $x_{i+1}$ leaves it, so $x_{i} \equiv j(\bmod m)$ and $x_{i+1}=2 j-1$ or $2 j$. Hence $2 x_{i} \equiv 2 j$ and $x_{i+1} \equiv 2 x_{i}$ or $2 x_{i}-1(\bmod n)$, as required. The graph $G$ is connected: by induction on $k$ there is a path from 1 to $k$, since 1 is connected to $j$ with $2 j=k$ or $2 j-1=k$, and there is an edge from $j$ to $k$. Also, the in-degree and out-degree of each vertex of $G$ are equal (to 2), and thus by a known result, $G$ contains an Euler circuit.


27. C7 (NZL) Among a group of 120 people, some pairs are friends. A weak quartet is a set of four people containing exactly one pair of friends. What is the maximum possible number of weak quartets?

Solution: 27. For a graph $G$ on 120 vertices (i.e., people at the party), write $q(G)$ for the number of weak quartets in $G$. Our solution will consist of three parts. First, we prove that some graph $G$ with maximal $q(G)$ breaks up as a disjoint union of complete graphs. This will follow if we show that any two adjacent vertices $x, y$ have the same neighbors (apart from themselves). Let $G_{x}$ be the graph obtained from $G$ by "copying" $x$ to $y$ (i.e., for each $z \neq x, y$, we add the edge $z y$ if $z x$ is an edge, and delete $z y$ if $z x$ is not an edge). Similarly $G_{y}$ is the graph obtained from $G$ by copying $y$ to $x$. We claim that $2 q(G) \leq q\left(G_{x}\right)+q\left(G_{y}\right)$. Indeed, the number of weak quartets containing neither $x$ nor $y$ is the same in $G, G_{x}$, and $G_{y}$, while the number of those containing both $x$ and $y$ is not less in $G_{x}$ and $G_{y}$ than in $G$. Also, the number containing exactly one of $x$ and $y$ in $G_{x}$ is at least twice the number in $G$ containing $x$ but not $y$, while the number containing exactly one of $x$ and $y$ in $G_{y}$ is at least twice the number in $G$ containing $y$ but not $x$. This justifies our claim by adding. It follows that for an extremal graph $G$ we must have $q(G)=q\left(G_{x}\right)=q\left(G_{y}\right)$. Repeating the copying operation pair by pair ( $y$ to $x$, then their common neighbor $z$ to both $x, y$, etc.) we eventually obtain an extremal graph consisting of disjoint complete graphs. Second, suppose the complete graphs in $G$ have sizes $a_{1}, a_{2}, \ldots, a_{n}$. Then  $$ q(G)=\sum_{i=1}^{n}\binom{a_{i}}{2} \sum_{\substack{j<k \\ j, k \neq i}} a_{j} a_{k} . $$  If we fix all the $a_{i}$ except two, say $p, q$, then $p+q=s$ is fixed, and for some constants $C_{i}, q(G)=C_{1}+C_{2} p q+C_{3}\left(\binom{p}{2}+\binom{q}{2}\right)+C_{4}\left(q\binom{p}{2}+p\binom{q}{2}\right)=$ $A+B p q$, where $A$ and $B$ depend only on $s$. Hence the maximum of $q(G)$ is attained if $|p-q| \leq 1$ or $p q=0$. Thus if $q(G)$ is maximal, any two nonzero $a_{i}$ 's differ by at most 1 . Finally, if $G$ consists of $n$ disjoint complete graphs, then $q(G)$ cannot exceed the value obtained if $a_{1}=\cdots=a_{n}$ (not necessarily integral), which equals  $$ Q_{n}=\frac{120^{2}}{n}\binom{120 / n}{2}\binom{n-1}{2}=30 \cdot 120^{2} \frac{(n-1)(n-2)(120-n)}{n^{3}} . $$  It is easy to check that $Q_{n}$ takes its maximum when $n=5$ and $a_{1}=\cdots=$ $a_{5}=24$, and that this maximum equals $15 \cdot 23 \cdot 24^{3}=4769280$.


3. N3 (MON) Let $p_{1}, p_{2}, \ldots, p_{n}$ be distinct primes greater than 3 . Show that $2^{p_{1} p_{2} \cdots p_{n}}+1$ has at least $4^{n}$ divisors.

Solution: 3. We observe that if $a, b$ are coprime odd numbers, then $\operatorname{gcd}\left(2^{a}+1,2^{b}+1\right)=$ 3. In fact, this g.c.d. divides $\operatorname{gcd}\left(2^{2 a}-1,2^{2 b}-1\right)=2^{\operatorname{gcd}(2 a, 2 b)}-1=2^{2}-1=$ 3 , while 3 obviously divides both $2^{a}+1$ and $2^{b}+1$. In particular, if $3 \nmid b$, then $3^{2} \nmid 2^{b}+1$, so $2^{a}+1$ and $\left(2^{b}+1\right) / 3$ are coprime; consequently $2^{a b}+1$ (being divisible by $\left.2^{a}+1,2^{b}+1\right)$ is divisible by $\frac{\left(2^{a}+1\right)\left(2^{b}+1\right)}{3}$. Now we prove the desired result by induction on $n$. For $n=1,2^{p_{1}}+1$ is divisible by 3 and exceeds $3^{2}$, so it has at least 4 divisors. Assume that $2^{a}+1=2^{p_{1} \cdots p_{n-1}}+1$ has at least $4^{n-1}$ divisors and consider $N=2^{a b}+1=$ $2^{p_{1} \cdots p_{n}}+1\left(\right.$ where $\left.b=p_{n}\right)$. As above, $2^{a}+1$ and $\frac{2^{b}+1}{3}$ are coprime, and thus $Q=\left(2^{a}+1\right)\left(2^{b}+1\right) / 3$ has at least $2 \cdot 4^{n-1}$ divisors. Moreover, $N$ is divisible by $Q$ and is greater than $Q^{2}$ (indeed, $N>2^{a b}>2^{2 a} 2^{2 b}>Q^{2}$ if $a, b \geq 5$ ). Then $N$ has at least twice as many divisors as $Q$ (because for every $d \mid Q$ both $d$ and $N / d$ are divisors of $N$ ), which counts up to $4^{n}$ divisors, as required. Remark. With some knowledge of cyclotomic polynomials, one can show that $2^{p_{1} \cdots p_{n}}+1$ has at least $2^{2^{n-1}}$ divisors, far exceeding $4^{n}$.


4. N4 (GER) Is there a positive integer $m$ such that the equation  $$ \frac{1}{a}+\frac{1}{b}+\frac{1}{c}+\frac{1}{a b c}=\frac{m}{a+b+c} $$  has infinitely many solutions in positive integers $a, b, c$ ?

Solution: 4. For $a=b=c=1$ we obtain $m=12$. We claim that the given equation has infinitely many solutions in positive integers $a, b, c$ for this value of $m$. After multiplication by $a b c(a+b+c)$ the equation $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}+\frac{1}{a b c}-\frac{12}{a+b+c}=0$ becomes  $$ a^{2}(b+c)+b^{2}(c+a)+c^{2}(a+b)+a+b+c-9 a b c=0 $$  We must show that this equation has infinitely many solutions in positive integers. Suppose that $(a, b, c)$ is one such solution with $a<b<c$. Regarding (1) as a quadratic equation in $a$, we see by Vieta's formula that ( $b, c, \frac{b c+1}{a}$ ) also satisfies (1).  Define $\left(a_{n}\right)_{n=0}^{\infty}$ by $a_{0}=a_{1}=a_{2}=1$ and $a_{n+1}=\frac{a_{n} a_{n-1}+1}{a_{n-2}}$ for each $n>1$. We show that all $a_{n}$ 's are integers. This procedure is fairly standard. The above relation for $n$ and $n-1$ gives $a_{n+1} a_{n-2}=a_{n} a_{n-1}+1$ and $a_{n-1} a_{n-2}+1=a_{n} a_{n-3}$, so that adding yields $a_{n-2}\left(a_{n-1}+a_{n+1}\right)=$ $a_{n}\left(a_{n-1}+a_{n-3}\right)$. Therefore $\frac{a_{n+1}+a_{n-1}}{a_{n}}=\frac{a_{n-1}+a_{n-3}}{a_{n-2}}=\cdots$, from which it follows that  $$ \frac{a_{n+1}+a_{n-1}}{a_{n}}=\left\{\begin{array}{l} \frac{a_{2}+a_{0}}{a_{1}}=2 \text { for } n \text { odd; } \\ \frac{a_{3}+a_{1}}{a_{2}}=3 \text { for } n \text { even. } \end{array}\right. $$  It is now an immediate consequence that every $a_{n}$ is integral. Also, the above consideration implies that $\left(a_{n-1}, a_{n}, a_{n+1}\right)$ is a solution of (1) for each $n \geq 1$. Since $a_{n}$ is strictly increasing, this gives an infinity of solutions in integers. Remark. There are infinitely many values of $m \in \mathbb{N}$ for which the given equation has at least one solution in integers, and each of those values admits an infinity of solutions.


5. N5 (IRN) Let $m, n \geq 2$ be positive integers, and let $a_{1}, a_{2}, \ldots, a_{n}$ be integers, none of which is a multiple of $m^{n-1}$. Show that there exist integers $e_{1}, e_{2}, \ldots, e_{n}$, not all zero, with $\left|e_{i}\right|<m$ for all $i$, such that $e_{1} a_{1}+e_{2} a_{2}+\cdots+e_{n} a_{n}$ is a multiple of $m^{n}$.

Solution: 5. Consider all possible sums $c_{1} a_{1}+c_{2} a_{2}+\cdots+c_{n} a_{n}$, where each $c_{i}$ is an integer with $0 \leq c_{i}<m$. There are $m^{n}$ such sums, and if any two of them give the same remainder modulo $m^{n}$, say $\sum c_{i} a_{i} \equiv \sum d_{i} a_{i}\left(\bmod m^{n}\right)$, then $\sum\left(c_{i}-d_{i}\right) a_{i}$ is divisible by $m^{n}$, and since $\left|c_{i}-d_{i}\right|<m$, we are done. We claim that two such sums must exist. Suppose to the contrary that the sums $\sum_{i} c_{i} a_{i}\left(0 \leq c_{i}<m\right)$ give all the different remainders modulo $m^{n}$. Consider the polynomial  $$ P(x)=\sum x^{c_{1} a_{1}+\cdots+c_{n} a_{n}}, $$  where the sum is taken over all $\left(c_{1}, \ldots, c_{n}\right)$ with $0 \leq c_{i}<m$. If $\xi$ is a primitive $m^{n}$ th root of unity, then by the assumption we have  $$ P(\xi)=1+\xi+\cdots+\xi^{m^{n}-1}=0 $$  On the other hand, $P(x)$ can be factored as  $$ P(x)=\prod_{i=1}^{n}\left(1+x^{a_{i}}+\cdots+x^{(m-1) a_{i}}\right)=\prod_{i=1}^{n} \frac{1-x^{m a_{i}}}{1-x^{a_{i}}}, $$  so that none of its factors is zero at $x=\xi$ because $m a_{i}$ is not divisible by $m^{n}$. This is obviously a contradiction. Remark. The example $a_{i}=m^{i-1}$ for $i=1, \ldots, n$ shows that the condition that no $a_{i}$ is a multiple of $m^{n-1}$ cannot be removed.


6. N6 (ROM) ${ }^{\mathrm{IMO} 3}$ Find all pairs of positive integers $m, n \geq 3$ for which there exist infinitely many positive integers $a$ such that  $$ \frac{a^{m}+a-1}{a^{n}+a^{2}-1} $$  is itself an integer.

Solution: 6. Suppose that $(m, n)$ is such a pair. Assume that division of the polynomial $F(x)=x^{m}+x-1$ by $G(x)=x^{n}+x^{2}-1$ gives the quotient $Q(x)$ and remainder $R(x)$. Since $\operatorname{deg} R(x)<\operatorname{deg} G(x)$, for $x$ large enough $|R(x)|<$ $|G(x)|$; however, $R(x)$ is divisible by $G(x)$ for infinitely many integers $x$, so it is equal to zero infinitely often. Hence $R \equiv 0$, and thus $F(x)$ is exactly divisible by $G(x)$. The polynomial $G(x)$ has a root $\alpha$ in the interval $(0,1)$, because $G(0)=-1$ and $G(1)=1$. Then also $F(\alpha)=0$, so that  $$ \alpha^{m}+\alpha=\alpha^{n}+\alpha^{2}=1 $$  If $m \geq 2 n$, then $1-\alpha=\alpha^{m} \leq\left(\alpha^{n}\right)^{2}=\left(1-\alpha^{2}\right)^{2}$, which is equivalent to $\alpha(\alpha-1)\left(\alpha^{2}+\alpha-1\right) \geq 0$. But this last is not possible, because $\alpha^{2}+\alpha-1>$ $\alpha^{m}+\alpha-1=0$; hence $m<2 n$. Now we have $F(x) / G(x)=x^{m-n}-\left(x^{m-n+2}-x^{m-n}-x+1\right) / G(x)$, so $H(x)=x^{m-n+2}-x^{m-n}-x+1$ is also divisible by $G(x)$; but $\operatorname{deg} H(x)=$ $m-n+2 \leq n+1=\operatorname{deg} G(x)+1$, from which we deduce that either $H(x)=G(x)$ or $H(x)=(x-a) G(x)$ for some $a \in \mathbb{Z}$. The former case is impossible. In the latter case we must have $m=2 n-1$, and thus $H(x)=x^{n+1}-x^{n-1}-x+1$; on the other hand, putting $x=1$ gives $a=1$, so $H(x)=(x-1)\left(x^{n}+x^{2}-1\right)=x^{n+1}-x^{n}+x^{3}-x^{2}-x+1$. This is possible only if $n=3$ and $m=5$. Remark. It is an old (though difficult) result that the polynomial $x^{n} \pm$ $x^{k} \pm 1$ is either irreducible or equals $x^{2} \pm x+1$ times an irreducible factor.


7. G1 (FRA) Let $B$ be a point on a circle $S_{1}$, and let $A$ be a point distinct from $B$ on the tangent at $B$ to $S_{1}$. Let $C$ be a point not on $S_{1}$ such that the line segment $A C$ meets $S_{1}$ at two distinct points. Let $S_{2}$ be the circle touching $A C$ at $C$ and touching $S_{1}$ at a point $D$ on the opposite side of $A C$ from $B$. Prove that the circumcenter of triangle $B C D$ lies on the circumcircle of triangle $A B C$.

Solution: 7. To avoid working with cases, we use oriented angles modulo $180^{\circ}$. Let $K$ be the circumcenter of $\triangle B C D$, and $X$ any point on the common tangent to the circles at $D$. Since the tangents at the ends of a chord are equally inclined to the chord, we have $\angle B A C=\angle A B D+\angle B D C+\angle D C A=$ $\angle B D X+\angle B D C+\angle X D C=2 \angle B D C=\angle B K C$. It follows that $B, C, A, K$ are concyclic, as required.


8. G2 (KOR) Let $A B C$ be a triangle for which there exists an interior point $F$ such that $\angle A F B=\angle B F C=\angle C F A$. Let the lines $B F$ and $C F$ meet the sides $A C$ and $A B$ at $D$ and $E$ respectively. Prove that  $$ A B+A C \geq 4 D E $$

Solution: 8. Construct equilateral triangles $A C P$ and $A B Q$ outside the triangle $A B C$. Since $\angle A P C+\angle A F C=60^{\circ}+120^{\circ}=180^{\circ}$, the points $A, C, F, P$ lie on a circle; hence $\angle A F P=\angle A C P=60^{\circ}=\angle A F D$, so $D$ lies on the segment $F P$; similarly, $E$ lies on $F Q$. Further, note that  $$ \frac{F P}{F D}=1+\frac{D P}{F D}=1+\frac{S_{A P C}}{S_{A F C}} \geq 4 $$  with equality if $F$ is the midpoint of the smaller $\operatorname{arc} A C$ : hence $F D \leq \frac{1}{4} F P$ and $F E \leq \frac{1}{4} F Q$. Then by the law of cosines,  $$ \begin{aligned} D E & =\sqrt{F D^{2}+F E^{2}+F D \cdot F E} \\ & \leq \frac{1}{4} \sqrt{F P^{2}+F Q^{2}+F P \cdot F Q}=\frac{1}{4} P Q \leq A P+A Q=A B+A C . \end{aligned} $$  Equality holds if and only if $\triangle A B C$ is equilateral.


9. G3 (KOR) ${ }^{\mathrm{IMO} 2}$ The circle $S$ has center $O$, and $B C$ is a diameter of $S$. Let $A$ be a point of $S$ such that $\measuredangle A O B<120^{\circ}$. Let $D$ be the midpoint of the arc $A B$ that does not contain $C$. The line through $O$ parallel to $D A$ meets the line $A C$ at $I$. The perpendicular bisector of $O A$ meets $S$ at $E$ and at $F$. Prove that $I$ is the incenter of the triangle $C E F$.

Solution: 9. Since $\angle B C A=\frac{1}{2} \angle B O A=\angle B O D$, the lines $C A$ and $O D$ are parallel, so that $O D A I$ is a parallelogram. It follows that $A I=O D=O E=A E=$ $A F$. Hence $\angle I F E=\angle I F A-\angle E F A=\angle A I F-\angle E C A=\angle A I F-\angle A C F=\angle C F I$. Also, from $A E=A F$ we get that $C I$ bisects $\angle E C F$. Therefore $I$ is the incenter of $\triangle C E F$.


1. A1 (USA) Let $a_{i j}, i=1,2,3, j=1,2,3$, be real numbers such that $a_{i j}$ is positive for $i=j$ and negative for $i \neq j$. Prove that there exist positive real numbers $c_{1}, c_{2}, c_{3}$ such that the numbers  $$ a_{11} c_{1}+a_{12} c_{2}+a_{13} c_{3}, \quad a_{21} c_{1}+a_{22} c_{2}+a_{23} c_{3}, \quad a_{31} c_{1}+a_{32} c_{2}+a_{33} c_{3} $$  are all negative, all positive, or all zero.

Solution: 1. Consider the points $O(0,0,0), P\left(a_{11}, a_{21}, a_{31}\right), Q\left(a_{12}, a_{22}, a_{32}\right), R\left(a_{13}, a_{23}\right.$, $\left.a_{33}\right)$ in three-dimensional Euclidean space. It is enough to find a point $U\left(u_{1}, u_{2}, u_{3}\right)$ in the interior of the triangle $P Q R$ whose coordinates are all positive, all negative, or all zero (indeed, then we have $\overrightarrow{O U}=c_{1} \overrightarrow{O P}+$ $c_{2} \overrightarrow{O Q}+c_{3} \overrightarrow{O R}$ for some $c_{1}, c_{2}, c_{3}>0$ with $\left.c_{1}+c_{2}+c_{3}=1\right)$. Let $P^{\prime}\left(a_{11}, a_{21}, 0\right), Q^{\prime}\left(a_{12}, a_{22}, 0\right)$, and $R^{\prime}\left(a_{13}, a_{23}, 0\right)$ be the projections of $P, Q$, and $R$ onto the $O x y$ plane. We see that $P^{\prime}, Q^{\prime}, R^{\prime}$ lie in the fourth, second, and third quadrants, respectively. We have the following two cases: (i) $O$ is in the exterior of $\triangle P^{\prime} Q^{\prime} R^{\prime}$. Set $S^{\prime}=O R^{\prime} \cap P^{\prime} Q^{\prime}$ and let $S$ be the point of the segment $P Q$ that projects to $S^{\prime}$. The point $S$ has its $z$ coordinate negative (because the $z$ coordinates of $P$ and $Q$ are negative). Thus any point ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-710.jpg?height=290&width=446&top_left_y=702&top_left_x=875) of the segment $S R$ sufficiently close to $S$ has all coordinates negative. (ii) $O$ is in the interior or on the boundary of $\triangle P^{\prime} Q^{\prime} R^{\prime}$.  Let $T$ be the point in the plane $P Q R$ whose projection is $O$. If $T=O$, then all coordinates of $T$ are zero, and we are done. Otherwise $O$ is interior to $\triangle P^{\prime} Q^{\prime} R^{\prime}$. Suppose that the $z$ coordinate of $T$ is positive (negative). Since $x$ and $y$ coordinates of $T$ are equal to 0 , there is a point $U$ inside $P Q R$ close to $T$ with both $x$ and $y$ coordinates positive (respectively negative), and this point $U$ has all coordinates of the same sign.


10. C4 (IRN) Let $x_{1}, \ldots, x_{n}$ and $y_{1}, \ldots, y_{n}$ be real numbers. Let $A=$ $\left(a_{i j}\right)_{1 \leq i, j \leq n}$ be the matrix with entries  $$ a_{i j}= \begin{cases}1, & \text { if } x_{i}+y_{j} \geq 0 \\ 0, & \text { if } x_{i}+y_{j}<0\end{cases} $$  Suppose that $B$ is an $n \times n$ matrix whose entries are 0,1 such that the sum of the elements in each row and each column of $B$ is equal to the corresponding sum for the matrix $A$. Prove that $A=B$.

Solution: 10. Denote by $b_{i j}$ the entries of the matrix $B$. Suppose the contrary, i.e., that there is a pair $\left(i_{0}, j_{0}\right)$ such that $a_{i_{0}, j_{0}} \neq b_{i_{0}, j_{0}}$. We may assume without loss of generality that $a_{i_{0}, j_{0}}=0$ and $b_{i_{0}, j_{0}}=1$. Since the sums of elements in the $i_{0}$ th rows of the matrices $A$ and $B$ are equal, there is some $j_{1}$ for which $a_{i_{0}, j_{1}}=1$ and $b_{i_{0}, j_{1}}=0$. Similarly, from the fact that the sums in the $j_{1}$ th columns of the matrices $A$ and $B$ are equal, we conclude that there exists $i_{1}$ such that $a_{i_{1}, j_{1}}=0$ and $b_{i_{1}, j_{1}}=1$. Continuing this procedure, we construct two sequences $i_{k}, j_{k}$ such that $a_{i_{k}, j_{k}}=0, b_{i_{k}, j_{k}}=1, a_{i_{k}, j_{k+1}}=1, b_{i_{k}, j_{k+1}}=0$. Since the set of the pairs $\left(i_{k}, j_{k}\right)$ is finite, there are two different numbers $t, s$ such that $\left(i_{t}, j_{t}\right)=\left(i_{s}, j_{s}\right)$. From the given condition we have that $x_{i_{k}}+y_{i_{k}}<0$ and $x_{i_{k+1}}+y_{i_{k+1}} \geq 0$. But $j_{t}=j_{s}$, and hence $0 \leq \sum_{k=s}^{t-1}\left(x_{i_{k}}+y_{j_{k+1}}\right)=$ $\sum_{k=s}^{t-1}\left(x_{i_{k}}+y_{j_{k}}\right)<0$, a contradiction.


11. C5 (ROM) Every point with integer coordinates in the plane is the center of a disk with radius $1 / 1000$. (a) Prove that there exists an equilateral triangle whose vertices lie in different disks. (b) Prove that every equilateral triangle with vertices in different disks has side length greater than 96.

Solution: 11. (a) By the pigeonhole principle there are two different integers $x_{1}, x_{2}$, $x_{1}>x_{2}$, such that $\left|\left\{x_{1} \sqrt{3}\right\}-\left\{x_{2} \sqrt{3}\right\}\right|<0.001$. Set $a=x_{1}-x_{2}$. Consider the equilateral triangle with vertices $(0,0),(2 a, 0),(a, a \sqrt{3})$. The points $(0,0)$ and $(2 a, 0)$ are lattice points, and we claim that the point $(a, a \sqrt{3})$ is at distance less than 0.001 from a lattice point. Indeed, since $0.001>\left|\left\{x_{1} \sqrt{3}\right\}-\left\{x_{2} \sqrt{3}\right\}\right|=\left|a \sqrt{3}-\left(\left[x_{1} \sqrt{3}\right]-\left[x_{2} \sqrt{3}\right]\right)\right|$, we see that the distance between the points $(a, a \sqrt{3})$ and $\left(a,\left[x_{1} \sqrt{3}\right]-\right.$ $\left.\left[x_{2} \sqrt{3}\right]\right)$ is less than 0.001 , and the point $\left(a,\left[x_{1} \sqrt{3}\right]-\left[x_{2} \sqrt{3}\right]\right)$ is with integer coefficients. (b) Suppose that $P^{\prime} Q^{\prime} R^{\prime}$ is an equilateral triangle with side length $l \leq 96$ such that each of its vertices $P^{\prime}, Q^{\prime}, R^{\prime}$ lies in a disk of radius 0.001 centered at a lattice point. Denote by $P, Q, R$ the centers of these disks. Then we have $l-0.002 \leq P Q, Q R, R P \leq l+0.002$. Since $P Q R$ is not an equilateral triangle, two of its sides are different, say $P Q \neq Q R$. On the other hand, $P Q^{2}, Q R^{2}$ are integers, so we have $1 \leq\left|P Q^{2}-Q R^{2}\right|=(P Q+Q R)|P Q-Q R| \leq 0.004(P Q+Q R) \leq$ $(2 l+0.004) \cdot 0.004 \leq 2 \cdot 96.002 \cdot 0.004<1$, which is a contradiction.


12. C6 (SAF) Let $f(k)$ be the number of integers $n$ that satisfy the following conditions: (i) $0 \leq n<10^{k}$, so $n$ has exactly $k$ digits (in decimal notation), with leading zeros allowed; (ii) the digits of $n$ can be permuted in such a way that they yield an integer divisible by 11 . Prove that $f(2 m)=10 f(2 m-1)$ for every positive integer $m$.

Solution: 12. Denote by $\overline{a_{k-1} a_{k-2} \ldots a_{0}}$ the decimal representation of a number whose digits are $a_{k-1}, \ldots, a_{0}$. We will use the following well-known fact:  $$ \overline{a_{k-1} a_{k-2} \ldots a_{0}} \equiv i(\bmod 11) \Longleftrightarrow \sum_{l=0}^{k-1}(-1)^{l} a_{l} \equiv i(\bmod 11) . $$  Let $m$ be a positive integer. Define $A$ as the set of integers $n(0 \leq n<$ $10^{2 m}$ ) whose right $2 m-1$ digits can be so permuted to yield an integer divisible by 11 , and $B$ as the set of integers $n\left(0 \leq n<10^{2 m-1}\right)$ whose digits can be permuted resulting in an integer divisible by 11. Suppose that $a=\overline{a_{2 m-1} \ldots a_{0}} \in A$. Then there that satisfies  $$ \sum_{l=0}^{2 m-1}(-1)^{l} b_{l} \equiv 0(\bmod 11) $$  The $2 m$-tuple $\left(b_{2 m-1}, \ldots, b_{0}\right)$ satisfies (1) if and only if the $2 m$-tuple $\left(k b_{2 m-1}+l, \ldots, k b_{0}+l\right)$ satisfies ( 1 ), where $k, l \in \mathbb{Z}, 11 \nmid k$. Since $a_{0}+1 \not \equiv 0(\bmod 11)$, we can choose $k$ from the set $\{1, \ldots, 10\}$ such that $\left(a_{0}+1\right) k \equiv 1(\bmod 11)$. Thus there is a permutation of the $2 m$-tuple $\left(\left(a_{2 m-1}+1\right) k-1, \ldots,\left(a_{1}+1\right) k-1,0\right)$ satisfying (1). Interchanging odd and even positions if necessary, we may assume that this permutation keeps the 0 at the last position. Since $\left(a_{i}+1\right) k$ is not divisible by 11 for any $i$, there is a unique $b_{i} \in\{0,1, \ldots, 9\}$ such that $b_{i} \equiv\left(a_{i}+1\right) k-1(\bmod 11)$. Hence the number $\overline{b_{2 m-1} \ldots b_{1}}$ belongs to $B$. Thus for fixed $a_{0} \in\{0,1,2, \ldots, 9\}$, to each $a \in A$ such that the last digit of $a$ is $a_{0}$ we associate a unique $b \in B$. Conversely, having $a_{0} \in$ $\{0,1,2, \ldots, 9\}$ fixed, from any number $\overline{b_{2 m-1} \ldots b_{1}} \in B$ we can reconstruct $\overline{a_{2 m-1} \ldots a_{1} a_{0}} \in A$. Hence $|A|=10|B|$, i.e., $f(2 m)=10 f(2 m-1)$.


13. G1 (FIN) ${ }^{\mathrm{IMO} 4}$ Let $A B C D$ be a cyclic quadrilateral. Let $P, Q, R$ be the feet of the perpendiculars from $D$ to the lines $B C, C A, A B$, respectively. Show that $P Q=Q R$ if and only if the bisectors of $\angle A B C$ and $\angle A D C$ are concurrent with $A C$.

Solution: 13. Denote by $K$ and $L$ the intersections of the bisectors of $\angle A B C$ and $\angle A D C$ with the line $A C$, respectively. Since $A B: B C=A K: K C$ and $A D: D C=A L: L C$, we have to prove that  $$ P Q=Q R \Leftrightarrow \frac{A B}{B C}=\frac{A D}{D C} . $$  Since the quadrilaterals $A Q D R$ and $Q P C D$ are cyclic, we see that ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-715.jpg?height=403&width=399&top_left_y=1567&top_left_x=862) $\angle R D Q=\angle B A C$ and $\angle Q D P=\angle A C B$. By the law of sines it follows that $\frac{A B}{B C}=\frac{\sin (\angle A C B)}{\sin (\angle B A C)}$ and that $Q R=A D \sin (\angle R D Q), Q P=$ $C D \sin (\angle Q D P)$. Now we have  $$ \frac{A B}{B C}=\frac{\sin (\angle A C B)}{\sin (\angle B A C)}=\frac{\sin (\angle Q D P)}{\sin (\angle R D Q)}=\frac{A D \cdot Q P}{Q R \cdot C D} $$  The statement (1) follows directly.


14. G2 (GRE) Three distinct points $A, B, C$ are fixed on a line in this order. Let $\Gamma$ be a circle passing through $A$ and $C$ whose center does not lie on the line $A C$. Denote by $P$ the intersection of the tangents to $\Gamma$ at $A$ and $C$. Suppose $\Gamma$ meets the segment $P B$ at $Q$. Prove that the intersection of the bisector of $\angle A Q C$ and the line $A C$ does not depend on the choice of $\Gamma$.

Solution: 14. Denote by $R$ the intersection point of the bisector of $\angle A Q C$ and the line $A C$. From $\triangle A C Q$ we get  $$ \frac{A R}{R C}=\frac{A Q}{Q C}=\frac{\sin \angle Q C A}{\sin \angle Q A C} $$  By the sine version of Ceva's theorem we have $\frac{\sin \angle A P B}{\sin \angle B P C} \cdot \frac{\sin \angle Q A C}{\sin \angle P A Q}$. $\frac{\sin \angle Q C P}{\sin \angle Q C A}=1$, which is equivalent to  $$ \frac{\sin \angle A P B}{\sin \angle B P C}=\left(\frac{\sin \angle Q C A}{\sin \angle Q A C}\right)^{2} $$  because $\angle Q C A=\angle P A Q$ and $\angle Q A C=\angle Q C P$. Denote by $S(X Y Z)$ the area of a triangle $X Y Z$. Then  $$ \frac{\sin \angle A P B}{\sin \angle B P C}=\frac{A P \cdot B P \cdot \sin \angle A P B}{B P \cdot C P \cdot \sin \angle B P C}=\frac{S(\Delta A B P)}{S(\Delta B C P)}=\frac{A B}{B C}, $$  which implies that $\left(\frac{A R}{R C}\right)^{2}=\frac{A B}{B C}$. Hence $R$ does not depend on $\Gamma$.


15. G3 (IND) Let $A B C$ be a triangle and let $P$ be a point in its interior. Denote by $D, E, F$ the feet of the perpendiculars from $P$ to the lines $B C$, $C A$, and $A B$, respectively. Suppose that  $$ A P^{2}+P D^{2}=B P^{2}+P E^{2}=C P^{2}+P F^{2} $$  Denote by $I_{A}, I_{B}, I_{C}$ the excenters of the triangle $A B C$. Prove that $P$ is the circumcenter of the triangle $I_{A} I_{B} I_{C}$.

Solution: 15. From the given equality we see that $0=\left(B P^{2}+P E^{2}\right)-\left(C P^{2}+P F^{2}\right)=$ $B F^{2}-C E^{2}$, so $B F=C E=x$ for some $x$. Similarly, there are $y$ and $z$ such that $C D=A F=y$ and $B D=A E=z$. It is easy to verify that $D$, $E$, and $F$ must lie on the segments $B C, C A, A B$. Denote by $a, b, c$ the length of the segments $B C, C A, A B$. It follows that $a=z+y, b=z+x, c=x+y$, so $D, E, F$ are the points where the excircles touch the sides of $\triangle A B C$. Hence $P, D$, and $I_{A}$ are collinear and  $$ \angle P I_{A} C=\angle D I_{A} C=90^{\circ}-\frac{180^{\circ}-\angle A C B}{2}=\frac{\angle A C B}{2} $$  In the same way we obtain that $\angle P I_{B} C=\frac{\angle A C B}{2}$ and $P I_{B}=P I_{A}$. Analogously, we get $P I_{C}=P I_{B}$, which implies that $P$ is the circumcenter of the triangle $I_{A} I_{B} I_{C}$.


16. G4 (ARM) Let $\Gamma_{1}, \Gamma_{2}, \Gamma_{3}, \Gamma_{4}$ be distinct circles such that $\Gamma_{1}, \Gamma_{3}$ are externally tangent at $P$, and $\Gamma_{2}, \Gamma_{4}$ are externally tangent at the same point $P$. Suppose that $\Gamma_{1}$ and $\Gamma_{2} ; \Gamma_{2}$ and $\Gamma_{3} ; \Gamma_{3}$ and $\Gamma_{4} ; \Gamma_{4}$ and $\Gamma_{1}$ meet at $A, B, C, D$, respectively, and that all these points are different from $P$. Prove that  $$ \frac{A B \cdot B C}{A D \cdot D C}=\frac{P B^{2}}{P D^{2}} $$

Solution: 16. Apply an inversion with center at $P$ and radius $r$; let $\widehat{X}$ denote the image of $X$. The circles $\Gamma_{1}, \Gamma_{2}, \Gamma_{3}, \Gamma_{4}$ are transformed into lines $\widehat{\Gamma_{1}}, \widehat{\Gamma_{2}}, \widehat{\Gamma_{3}}, \widehat{\Gamma}_{4}$, where $\widehat{\Gamma_{1}} \| \widehat{\Gamma_{3}}$ and $\widehat{\Gamma_{2}} \| \widehat{\Gamma_{4}}$, and therefore $\widehat{A} \widehat{B} \widehat{C} \widehat{D}$ is a parallelogram. Further, we have $A B=\frac{r^{2}}{P \widehat{A} \cdot P \widehat{B}} \widehat{A} \widehat{B}, B C=\frac{r^{2}}{P \widehat{B} \cdot P \widehat{C}} \widehat{B} \widehat{C}, C D=\frac{r^{2}}{P \widehat{C} \cdot P \widehat{D}} \widehat{C} \widehat{D}$, $D A=\frac{r^{2}}{P \widehat{D} \cdot P \widehat{A}} \widehat{D} \widehat{A}$ and $P B=\frac{r^{2}}{P \widehat{B}}, P D=\frac{r^{2}}{P \widehat{D}}$. The equality to be proven becomes  $$ \frac{P \widehat{D}^{2}}{P \widehat{B}^{2}} \cdot \frac{\widehat{A} \widehat{B} \cdot \widehat{B} \widehat{C}}{\widehat{A} \cdot \widehat{D} \widehat{C}}=\frac{P \widehat{D}^{2}}{P \widehat{B}^{2}} $$  which holds because $\widehat{A} \widehat{B}=\widehat{C} \widehat{D}$ and $\widehat{B} \widehat{C}=\widehat{D} \widehat{A}$.


17. G5 (KOR) Let $A B C$ be an isosceles triangle with $A C=B C$, whose incenter is $I$. Let $P$ be a point on the circumcircle of the triangle $A I B$ lying inside the triangle $A B C$. The lines through $P$ parallel to $C A$ and $C B$ meet $A B$ at $D$ and $E$, respectively. The line through $P$ parallel to $A B$ meets $C A$ and $C B$ at $F$ and $G$, respectively. Prove that the lines $D F$ and $E G$ intersect on the circumcircle of the triangle $A B C$.

Solution: 17. The triangles $P D E$ and $C F G$ are homothetic; hence lines $F D, G E$, and $C P$ intersect at one point. Let $Q$ be the intersection point of the line $C P$ and the circumcircle of $\triangle A B C$. The required statement will follow if we show that $Q$ lies on the lines $G E$ and $F D$. Since $\angle C F G=\angle C B A=\angle C Q A$, the quadrilateral $A Q P F$ is cyclic. Analogously, $B Q P G$ is cyclic. However, the isosceles trapezoid $B D P G$ is also cyclic; it follows that $B, Q, D, P, G$ lie on a circle. Therefore we get  $$ \angle P Q F=\angle P A C, \angle P Q D=\angle P B A . $$  Since $I$ is the incenter of $\triangle A B C$, we have $\angle C A I=\frac{1}{2} \angle C A B=$ $\frac{1}{2} \angle C B A=\angle I B A$; hence $C A$ is the tangent at $A$ to the circumcircle of $\triangle A B I$. This implies that $\angle P A C=$ $\angle P B A$, and it follows from (1) that $\angle P Q F=\angle P Q D$, i.e., that $F, D, Q$ are also collinear. Similarly, $G, E, Q$ are collinear and the claim is thus proved. ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-717.jpg?height=412&width=358&top_left_y=632&top_left_x=903)


18. G6 (POL) ${ }^{\mathrm{IMO} 3}$ Each pair of opposite sides of a convex hexagon has the following property: The distance between their midpoints is equal to $\sqrt{3} / 2$ times the sum of their lengths. Prove that all the angles of the hexagon are equal.

Solution: 18. Let $A B C D E F$ be the given hexagon. We shall use the following lemma. Lemma. If $\angle X Z Y \geq 60^{\circ}$ and if $M$ is the midpoint of $X Y$, then $M Z \leq$ $\frac{\sqrt{3}}{2} X Y$, with equality if and only if $\triangle X Y Z$ is equilateral. Proof. Let $Z^{\prime}$ be the point such that $\triangle X Y Z^{\prime}$ is equilateral. Then $Z$ is inside the circle circumscribed about $\triangle X Y Z^{\prime}$. Consequently $M Z \leq$ $M Z^{\prime}=\frac{\sqrt{3}}{2} X Y$, with equality if and only if $Z=Z^{\prime}$. Set $A D \cap B E=P, B E \cap C F=Q$, and $C F \cap A D=R$. Suppose $\angle A P B=$ $\angle D P E>60^{\circ}$, and let $K, L$ be the midpoints of the segments $A B$ and $D E$ respectively. Then by the lemma,  $$ \frac{\sqrt{3}}{2}(A B+D E)=K L \leq P K+P L<\frac{\sqrt{3}}{2}(A B+D E), $$  which is impossible. Therefore $\angle A P B \leq 60^{\circ}$ and similarly $\angle B Q C \leq 60^{\circ}$, $\angle C R D \leq 60^{\circ}$. But the sum of the angles $A P B, B Q C, C R D$ is $180^{\circ}$, from which we conclude that these angles are all equal to $60^{\circ}$, and moreover that the triangles $A P B, B Q C, C R D$ are equilateral. Thus $\angle A B C=\angle A B P+$ $\angle Q B C=120^{\circ}$, and in the same way all angles of the hexagon are equal to $120^{\circ}$.


19. G7 (SAF) Let $A B C$ be a triangle with semiperimeter $s$ and inradius $r$. The semicircles with diameters $B C, C A, A B$ are drawn outside of the triangle $A B C$. The circle tangent to all three semicircles has radius $t$. Prove that  $$ \frac{s}{2}<t \leq \frac{s}{2}+\left(1-\frac{\sqrt{3}}{2}\right) r $$

Solution: 19. Let $D, E, F$ be the midpoints of $B C, C A, A B$, respectively. We construct smaller semicircles $\Gamma_{d}, \Gamma_{e}, \Gamma_{f}$ inside $\triangle A B C$ with centers $D, E, F$ and radii $d=\frac{s-a}{2}, e=\frac{s-b}{2}, f=\frac{s-c}{2}$ respectively. Since $D E=d+e, D F=d+f$, and $E F=e+f$, we deduce that $\Gamma_{d}, \Gamma_{e}$, and $\Gamma_{f}$ touch each other at the points $D_{1}, E_{1}, F_{1}$ of tangency of the incircle $\gamma$ of $\triangle D E F$ with its sides ( $D_{1} \in E F$, etc.). Consider the circle $\Gamma_{g}$ with center $O$ and radius $g$ that lies inside $\triangle D E F$ and tangents $\Gamma_{d}, \Gamma_{e}, \Gamma_{f}$.  Now let $O D, O E, O F$ meet the semicircles $\Gamma_{d}, \Gamma_{e}, \Gamma_{f}$ at $D^{\prime}, E^{\prime}, F^{\prime}$ respectively. We have $O D^{\prime}=O D+$ $D D^{\prime}=g+d+\frac{a}{2}=g+\frac{s}{2}$ and similarly $O E^{\prime}=O F^{\prime}=g+\frac{s}{2}$. It follows that the circle with center $O$ and radius $g+\frac{s}{2}$ touches all three semicircles, and consequently $t=$ $g+\frac{s}{2}>\frac{s}{2}$. Now set the coordinate system such that we have the points $D_{1}(0,0), E(-e, 0), F(f, 0)$ and such that the $y$ coordinate of $D$ is positive. ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-718.jpg?height=528&width=529&top_left_y=233&top_left_x=831)  Apply the inversion with center $D_{1}$ and unit radius. This inversion maps the circles $\Gamma_{e}$ and $\Gamma_{f}$ to the lines $\widehat{\Gamma_{e}}\left[x=-\frac{1}{2 e}\right]$ and $\widehat{\Gamma_{e}}\left[x=\frac{1}{2 f}\right]$ respectively, and the circle $\gamma$ goes to the line $\widehat{\gamma}\left[y=\frac{1}{r}\right]$. The images $\widehat{\Gamma_{d}}$ and $\widehat{\Gamma_{g}}$ of $\Gamma_{d}, \Gamma_{g}$ are the circles that touch the lines $\widehat{\Gamma_{e}}$ and $\widehat{\Gamma_{f}}$. Since $\widehat{\Gamma_{d}}, \widehat{\Gamma_{g}}$ are perpendicular to $\gamma$, they have radii equal to $R=\frac{1}{4 e}+\frac{1}{4 f}$ and centers at $\left(-\frac{1}{4 e}+\frac{1}{4 f}, \frac{1}{r}\right)$ and $\left(-\frac{1}{4 e}+\frac{1}{4 f}, \frac{1}{r}+2 R\right)$ respectively. Let $p$ and $P$ be the distances from $D_{1}(0,0)$ to the centers of $\Gamma_{g}$ and $\widehat{\Gamma_{g}}$ respectively. We have that $P^{2}=\left(\frac{1}{4 e}-\frac{1}{4 f}\right)^{2}+\left(\frac{1}{r}+2 R\right)^{2}$, and that the circles $\Gamma_{g}$ and $\widehat{\Gamma_{g}}$ are homothetic with center of homothety $D_{1}$; hence $p / P=g / R$. On the other hand, $\widehat{\Gamma_{g}}$ is the image of $\Gamma_{g}$ under inversion; hence the product of the tangents from $D_{1}$ to these two circles is equal to 1 . In other words, we obtain $\sqrt{p^{2}-g^{2}} \cdot \sqrt{P^{2}-R^{2}}=1$. Using the relation $p / P=g / R$ we get $g=\frac{R}{P^{2}-R^{2}}$. The inequality we have to prove is equivalent to $(4+2 \sqrt{3}) g \leq r$. This can be proved as follows:  $$ \begin{aligned} r-(4+2 \sqrt{3}) g & =\frac{r\left(P^{2}-R^{2}-(4+2 \sqrt{3}) R / r\right)}{P^{2}-R^{2}} \\ & =\frac{r\left(\left(\frac{1}{r}+2 R\right)^{2}+\left(\frac{1}{4 e}-\frac{1}{4 f}\right)^{2}-R^{2}-(4+2 \sqrt{3}) \frac{R}{r}\right)}{P^{2}-R^{2}} \\ & =\frac{r}{P^{2}-R^{2}}\left(\left(R \sqrt{3}-\frac{1}{r}\right)^{2}+\left(\frac{1}{4 e}-\frac{1}{4 f}\right)^{2}\right) \geq 0 \end{aligned} $$  Remark. One can obtain a symmetric formula for $g$ :  $$ \frac{1}{2 g}=\frac{1}{s-a}+\frac{1}{s-b}+\frac{1}{s-c}+\frac{2}{r} $$


2. A2 (AUS) Find all nondecreasing functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that (i) $f(0)=0, f(1)=1$; (ii) $f(a)+f(b)=f(a) f(b)+f(a+b-a b)$ for all real numbers $a, b$ such that $a<1<b$.

Solution: 2. We can rewrite (ii) as $-(f(a)-1)(f(b)-1)=f(-(a-1)(b-1)+1)-1$. So putting $g(x)=f(x+1)-1$, this equation becomes $-g(a-1) g(b-1)=$ $g(-(a-1)(b-1))$ for $a<1<b$. Hence  $$ -g(x) g(y)=g(-x y) \text { for } x<0<y $$  and $g$ is nondecreasing with $g(-1)=-1, g(0)=0$. Conversely, if $g$ satisfies (1), than $f$ is a solution of our problem. Setting $y=1$ in (1) gives $-g(-x) g(1)=g(x)$ for each $x>0$, and therefore (1) reduces to $g(1) g(y z)=g(y) g(z)$ for all $y, z>0$. We have two cases: (i) $g(1)=0$. By (1) we have $g(z)=0$ for all $z>0$. Then any nondecreasing function $g: \mathbb{R} \rightarrow \mathbb{R}$ with $g(-1)=-1$ and $g(z)=0$ for $z \geq 0$ satisfies (1) and gives a solution: $f$ is nondecreasing, $f(0)=0$ and $f(x)=1$ for every $x \geq 1$ (ii) $g(1) \neq 0$. Then the function $h(x)=\frac{g(x)}{g(1)}$ is nondecreasing and satisfies $h(0)=0, h(1)=1$, and $h(x y)=h(x) h(y)$. Fix $a>0$, and let $h(a)=$ $b=a^{k}$ for some $k \in \mathbb{R}$. It follows by induction that $h\left(a^{q}\right)=h(a)^{q}=$ $\left(a^{q}\right)^{k}$ for every rational number $q$. But $h$ is nondecreasing, so $k \geq 0$, and since the set $\left\{a^{q} \mid q \in \mathbb{Q}\right\}$ is dense in $\mathbb{R}^{+}$, we conclude that $h(x)=x^{k}$ for every $x>0$. Finally, putting $g(1)=c$, we obtain $g(x)=c x^{k}$ for all $x>0$. Then $g(-x)=-x^{k}$ for all $x>0$. This $g$ obviously satisfies (1). Hence  $$ f(x)=\left\{\begin{array}{ll} c(x-1)^{k}, & \text { if } x>1 ; \\ 1, & \text { if } x=1 ; \\ 1-(1-x)^{k}, & \text { if } x<1 \end{array} \quad \text { where } c>0 \text { and } k \geq 0\right. $$


20. N1 (POL) Let $m$ be a fixed integer greater than 1 . The sequence $x_{0}, x_{1}, x_{2}, \ldots$ is defined as follows:  $$ x_{i}= \begin{cases}2^{i}, & \text { if } 0 \leq i \leq m-1 \\ \sum_{j=1}^{m} x_{i-j}, & \text { if } i \geq m\end{cases} $$  Find the greatest $k$ for which the sequence contains $k$ consecutive terms divisible by $m$.

Solution: 20. Let $r_{i}$ be the remainder when $x_{i}$ is divided by $m$. Since there are at most $m^{m}$ types of $m$-consecutive blocks in the sequence $\left(r_{i}\right)$, some type will repeat at least twice. Then since the entire sequence is determined by one $m$-consecutive block, the entire sequence will be periodic. The formula works both forward and backward; hence using the rule $x_{i}=$ $x_{i+m}-\sum_{j=1}^{m-1} x_{i+j}$ we can define $x_{-1}, x_{-2}, \ldots$. Thus we obtain that  $$ \left(r_{-m}, \ldots, r_{-1}\right)=(0,0, \ldots, 0,1) $$  Hence there are $m-1$ consecutive terms in the sequence $\left(x_{i}\right)$ that are divisible by $m$. If there were $m$ consecutive terms in the sequence $\left(x_{i}\right)$ divisible by $m$, then by the recurrence relation all the terms of $\left(x_{i}\right)$ would be divisible by $m$, which is impossible.


21. N2 (USA) Each positive integer $a$ undergoes the following procedure in order to obtain the number $d=d(a)$ : (1) move the last digit of $a$ to the first position to obtain the number $b$; (2) square $b$ to obtain the number $c$; (3) move the first digit of $c$ to the end to obtain the number $d$. (All the numbers in the problem are considered to be represented in base 10.) For example, for $a=2003$, we have $b=3200, c=10240000$, and $d=02400001=2400001=d(2003)$. Find all numbers $a$ for which $d(a)=a^{2}$.

Solution: 21. Let $a$ be a positive integer for which $d(a)=a^{2}$. Suppose that $a$ has $n+1$ digits, $n \geq 0$. Denote by $s$ the last digit of $a$ and by $f$ the first digit of $c$. Then $a=\overline{* \ldots * s}$, where $*$ stands for a digit that is not important to us at the moment. We have $\overline{\ldots * s^{2}}=a^{2}=d=\overline{* \ldots * f}$ and $b^{2}=\overline{s * \ldots *}^{2}=$ $c=\overline{f * \ldots *}$. We cannot have $s=0$, since otherwise $c$ would have at most $2 n$ digits, while $a^{2}$ has either $2 n+1$ or $2 n+2$ digits. The following table gives all possibilities for $s$ and $f$ :  | $s$ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | $f=$ last digit of $\overline{* \ldots * s}^{2}$ | 1 | 4 | 9 | 6 | 5 | 6 | 9 | 4 | 1 | | $f=$ first digit of $\overline{s * \ldots *}^{2}$ | $1,2,3$ | $4-8$ | 9,1 | 1,2 | 2,3 | 3,4 | $4,5,6$ | $6,7,8$ | 8,9 |  We obtain from the table that $s \in\{1,2,3\}$ and $f=s^{2}$, and consequently $c=b^{2}$ and $d$ have exactly $2 n+1$ digits each. Put $a=10 x+s$, where $x<10^{n}$. Then $b=10^{n} s+x, c=10^{2 n} s^{2}+2 \cdot 10^{n} s x+x^{2}$, and $d=$ $2 \cdot 10^{n+1} s x+10 x^{2}+s^{2}$, so from $d=a^{2}$ it follows that $x=2 s \cdot \frac{10^{n}-1}{9}$. Thus $a=\underbrace{6 \ldots 6}_{n} 3, a=\underbrace{4 \ldots 4}_{n} 2$ or $a=\underbrace{2 \ldots 2}_{n} 1$. For $n \geq 1$ we see that $a$ cannot be $a=6 \ldots 63$ or $a=4 \ldots 42$ (otherwise $a^{2}$ would have $2 n+2$ digits). Therefore $a$ equals $1,2,3$ or $\underbrace{2 \ldots 2}_{n} 1$ for $n \geq 0$. It is easy to verify that these numbers have the required property.


22. N3 (BUL) ${ }^{\mathrm{IMO} 2}$ Determine all pairs $(a, b)$ of positive integers such that  $$ \frac{a^{2}}{2 a b^{2}-b^{3}+1} $$  is a positive integer.

Solution: 22. Let $a$ and $b$ be positive integers for which $\frac{a^{2}}{2 a b^{2}-b^{3}+1}=k$ is a positive integer. Since $k>0$, it follows that $2 a b^{2} \geq b^{3}$, so $2 a \geq b$. If $2 a>b$, then from $2 a b^{2}-b^{3}+1>0$ we see that $a^{2}>b^{2}(2 a-b)+1>b^{2}$, i.e. $a>b$. Therefore, if $a \leq b$, then $a=b / 2$. We can rewrite the given equation as a quadratic equation in $a, a^{2}-$ $2 k b^{2} a+k\left(b^{3}-1\right)=0$, which has two solutions, say $a_{1}$ and $a_{2}$, one of which is in $\mathbb{N}_{0}$. From $a_{1}+a_{2}=2 k b^{2}$ and $a_{1} a_{2}=k\left(b^{3}-1\right)$ it follows that the other solution is also in $\mathbb{N}_{0}$. Suppose w.l.o.g. that $a_{1} \geq a_{2}$. Then $a_{1} \geq k b^{2}$ and  $$ 0 \leq a_{2}=\frac{k\left(b^{3}-1\right)}{a_{1}} \leq \frac{k\left(b^{3}-1\right)}{k b^{2}}<b . $$  By the above considerations we have either $a_{2}=0$ or $a_{2}=b / 2$. If $a_{2}=0$, then $b^{3}-1=0$ and hence $a_{1}=2 k, b=1$. If $a_{2}=b / 2$, then $b=2 t$ for some $t$, and $k=b^{2} / 4, a_{1}=b^{4} / 2-b / 2$. Therefore the only solutions are  $$ (a, b) \in\left\{(2 t, 1),(t, 2 t),\left(8 t^{4}-t, 2 t\right) \mid t \in \mathbb{N}\right\} $$  It is easy to show that all of these pairs satisfy the given condition.


23. N4 (ROM) Let $b$ be an integer greater than 5 . For each positive integer $n$, consider the number  $$ x_{n}=\underbrace{11 \ldots 1}_{n-1} \underbrace{22 \ldots 2}_{n} 5, $$  written in base $b$. Prove that the following condition holds if and only if $b=10$ : There exists a positive integer $M$ such that for every integer $n$ greater than $M$, the number $x_{n}$ is a perfect square.

Solution: 23. Assume that $b \geq 6$ has the required property. Consider the sequence $y_{n}=(b-1) x_{n}$. From the definition of $x_{n}$ we easily find that $y_{n}=b^{2 n}+$ $b^{n+1}+3 b-5$. Then $y_{n} y_{n+1}=(b-1)^{2} x_{n} x_{n+1}$ is a perfect square for all $n>M$. Also, straightforward calculation implies  $$ \left(b^{2 n+1}+\frac{b^{n+2}+b^{n+1}}{2}-b^{3}\right)^{2}<y_{n} y_{n+1}<\left(b^{2 n+1}+\frac{b^{n+2}+b^{n+1}}{2}+b^{3}\right)^{2} $$  Hence for every $n>M$ there is an integer $a_{n}$ such that $\left|a_{n}\right|<b^{3}$ and  $$ \begin{aligned} y_{n} y_{n+1} & =\left(b^{2 n}+b^{n+1}+3 b-5\right)\left(b^{2 n+2}+b^{n+2}+3 b-5\right) \\ & =\left(b^{2 n+1}+\frac{b^{n+1}(b+1)}{2}+a_{n}\right)^{2} . \end{aligned} $$  Now considering this equation modulo $b^{n}$ we obtain $(3 b-5)^{2} \equiv a_{n}^{2}$, so that assuming that $n>3$ we get $a_{n}= \pm(3 b-5)$. If $a_{n}=3 b-5$, then substituting in (1) yields $\frac{1}{4} b^{2 n}\left(b^{4}-14 b^{3}+45 b^{2}-\right.$ $52 b+20)=0$, with the unique positive integer solution $b=10$. Also, if $a_{n}=-3 b+5$, we similarly obtain $\frac{1}{4} b^{2 n}\left(b^{4}-14 b^{3}-3 b^{2}+28 b+20\right)-$ $2 b^{n+1}\left(3 b^{2}-2 b-5\right)=0$ for each $n$, which is impossible. For $b=10$ it is easy to show that $x_{n}=\left(\frac{10^{n}+5}{3}\right)^{2}$ for all $n$. This proves the statement. Second solution. In problems of this type, computing $z_{n}=\sqrt{x_{n}}$ asymptotically usually works. From $\lim _{n \rightarrow \infty} \frac{b^{2 n}}{(b-1) x_{n}}=1$ we infer that $\lim _{n \rightarrow \infty} \frac{b^{n}}{z_{n}}=\sqrt{b-1}$. Furthermore, from $\left(b z_{n}+z_{n+1}\right)\left(b z_{n}-z_{n+1}\right)=b^{2} x_{n}-x_{n+1}=b^{n+2}+3 b^{2}-2 b-5$ we obtain  $$ \lim _{n \rightarrow \infty}\left(b z_{n}-z_{n+1}\right)=\frac{b \sqrt{b-1}}{2} $$  Since the $z_{n}$ 's are integers for all $n \geq M$, we conclude that $b z_{n}-z_{n+1}=$ $\frac{b \sqrt{b-1}}{2}$ for all $n$ sufficiently large. Hence $b-1$ is a perfect square, and moreover $b$ divides $2 z_{n+1}$ for all large $n$. It follows that $b \mid 10$; hence the only possibility is $b=10$.


24. N5 (KOR) An integer $n$ is said to be good if $|n|$ is not the square of an integer. Determine all integers $m$ with the following property: $m$ can be represented in infinitely many ways as a sum of three distinct good integers whose product is the square of an odd integer.

Solution: 24. Suppose that $m=u+v+w$ where $u, v, w$ are good integers whose product is a perfect square of an odd integer. Since $u v w$ is an odd perfect square, we have that $u v w \equiv 1(\bmod 4)$. Thus either two or none of the numbers $u, v, w$ are congruent to 3 modulo 4 . In both cases $u+v+w \equiv 3(\bmod 4)$. Hence $m \equiv 3(\bmod 4)$. Now we shall prove the converse: every $m \equiv 3(\bmod 4)$ has infinitely many representations of the desired type. Let $m=4 k+3$. We shall represent $m$ in the form  $$ 4 k+3=x y+y z+z x, \quad \text { for } x, y, z \text { odd. } $$  The product of the summands is an odd square. Set $x=1+2 l$ and $y=1-2 l$. In order to satisfy (1), $z$ must satisfy $z=2 l^{2}+2 k+1$. The summands $x y, y z, z x$ are distinct except for finitely many $l$, so it remains only to prove that for infinitely many integers $l,|x y|,|y z|$, and $|z x|$ are not perfect squares. First, observe that $|x y|=4 l^{2}-1$ is not a perfect square for any $l \neq 0$. Let $p, q>m$ be fixed different prime numbers. The system of congruences $1+2 l \equiv p\left(\bmod p^{2}\right)$ and $1-2 l \equiv q\left(\bmod q^{2}\right)$ has infinitely many solutions $l$ by the Chinese remainder theorem. For any such $l$, the number $z=$ $2 l^{2}+2 k+1$ is divisible by neither $p$ nor $q$, and hence $|x z|$ (respectively $|y z|)$ is divisible by $p$, but not by $p^{2}$ (respectively by $q$, but not by $q^{2}$ ). Thus $x z$ and $y z$ are also good numbers.


25. N6 (FRA) ${ }^{\text {IMO6 }}$ Let $p$ be a prime number. Prove that there exists a prime number $q$ such that for every integer $n$, the number $n^{p}-p$ is not divisible by $q$.

Solution: 25. Suppose that for every prime $q$, there exists an $n$ for which $n^{p} \equiv p(\bmod$ $q$ ). Assume that $q=k p+1$. By Fermat's theorem we deduce that $p^{k} \equiv$ $n^{k p}=n^{q-1} \equiv 1(\bmod q)$, so $q \mid p^{k}-1$. It is known that any prime $q$ such that $q \left\lvert\, \frac{p^{p}-1}{p-1}\right.$ must satisfy $q \equiv 1(\bmod$ $p$ ). Indeed, from $q \mid p^{q-1}-1$ it follows that $q \mid p^{\operatorname{gcd}(p, q-1)}-1$; but $q \nmid p-1$ because $\frac{p^{p}-1}{p-1} \equiv 1(\bmod p-1)$, so $\operatorname{gcd}(p, q-1) \neq 1$. Hence $\operatorname{gcd}(p, q-1)=p$. Now suppose $q$ is any prime divisor of $\frac{p^{p}-1}{p-1}$. Then $q \mid \operatorname{gcd}\left(p^{k}-1, p^{p}-1\right)=$ $p^{\operatorname{gcd}(p, k)}-1$, which implies that $\operatorname{gcd}(p, k)>1$, so $p \mid k$. Consequently $q \equiv 1$ $\left(\bmod p^{2}\right)$. However, the number $\frac{p^{p}-1}{p-1}=p^{p-1}+\cdots+p+1$ must have at least one prime divisor that is not congruent to 1 modulo $p^{2}$. Thus we arrived at a contradiction. Remark. Taking $q \equiv 1(\bmod p)$ is natural, because for every other $q, n^{p}$ takes all possible residues modulo $q$ (including $p$ too). Indeed, if $p \nmid q-1$, then there is an $r \in \mathbb{N}$ satisfying $p r \equiv 1(\bmod q-1)$; hence for any $a$ the congruence $n^{p} \equiv a(\bmod q)$ has the solution $n \equiv a^{r}(\bmod q)$. The statement of the problem itself is a special case of the Chebotarev's theorem.


26. N7 (BRA) The sequence $a_{0}, a_{1}, a_{2}, \ldots$ is defined as follows:  $$ a_{0}=2, \quad a_{k+1}=2 a_{k}^{2}-1 \quad \text { for } k \geq 0 $$  Prove that if an odd prime $p$ divides $a_{n}$, then $2^{n+3}$ divides $p^{2}-1$.

Solution: 26. Define the sequence $x_{k}$ of positive reals by $a_{k}=\cosh x_{k}$ ( $\cosh$ is the hyperbolic cosine defined by $\left.\cosh t=\frac{e^{t}+e^{-t}}{2}\right)$. Since $\cosh \left(2 x_{k}\right)=2 a_{k}^{2}-1=$ $\cosh x_{k+1}$, it follows that $x_{k+1}=2 x_{k}$ and thus $x_{k}=\lambda \cdot 2^{k}$ for some $\lambda>0$. From the condition $a_{0}=2$ we obtain $\lambda=\log (2+\sqrt{3})$. Therefore  $$ a_{n}=\frac{(2+\sqrt{3})^{2^{n}}+(2-\sqrt{3})^{2^{n}}}{2} $$  Let $p$ be a prime number such that $p \mid a_{n}$. We distinguish the following two cases: (i) There exists an $m \in \mathbb{Z}$ such that $m^{2} \equiv 3(\bmod p)$. Then we have  $$ (2+m)^{2^{n}}+(2-m)^{2^{n}} \equiv 0(\bmod p) $$  Since $(2+m)(2-m)=4-m^{2} \equiv 1(\bmod p)$, multiplying both sides of $(1)$ by $(2+m)^{2^{n}}$ gives $(2+m)^{2^{n+1}} \equiv-1(\bmod p)$. It follows that the multiplicative order of $(2+m)$ modulo $p$ is $2^{n+2}$, or $2^{n+2} \mid p-1$, which implies that $2^{n+3} \mid(p-1)(p+1)=p^{2}-1$. (ii) $m^{2} \equiv 3(\bmod p)$ has no integer solutions. We will work in the algebraic extension $\mathbb{Z}_{p}(\sqrt{3})$ of the field $\mathbb{Z}_{p}$. In this field $\sqrt{3}$ plays the role of $m$, so as in the previous case we obtain $(2+\sqrt{3})^{2^{n+1}}=-1$; i.e., the order of $2+\sqrt{3}$ in the multiplicative group $\mathbb{Z}_{p}(\sqrt{3})^{*}$ is $2^{n+2}$. We cannot finish the proof as in the previous case: in fact, we would conclude only that $2^{n+2}$ divides the order $p^{2}-1$ of the group. However, it will be enough to find a $u \in \mathbb{Z}_{p}(\sqrt{3})$ such that $u^{2}=2+\sqrt{3}$, since then the order of $u$ is equal to $2^{n+3}$. Note that $(1+\sqrt{3})^{2}=2(2+\sqrt{3})$. Thus it is sufficient to prove that $\frac{1}{2}$ is a perfect square in $\mathbb{Z}_{p}(\sqrt{3})$. But we know that in this field $a_{n}=$ $0=2 a_{n-1}^{2}-1$, and hence $2 a_{n-1}^{2}=1$ which implies $\frac{1}{2}=a_{n-1}^{2}$. This completes the proof.


27. N8 (IRN) Let $p$ be a prime number and let $A$ be a set of positive integers that satisfies the following conditions: (i) the set of prime divisors of the elements in $A$ consists of $p-1$ elements; (ii) for any nonempty subset of $A$, the product of its elements is not a perfect $p$ th power. What is the largest possible number of elements in $A$ ?

Solution: 27. Let $p_{1}, p_{2}, \ldots, p_{r}$ be distinct primes, where $r=p-1$. Consider the sets $B_{i}=\left\{p_{i}, p_{i}^{p+1}, \ldots, p_{i}^{(r-1) p+1}\right\}$ and $B=\bigcup_{i=1}^{r} B_{i}$. Then $B$ has $(p-1)^{2}$ elements and satisfies (i) and (ii). Now suppose that $|A| \geq r^{2}+1$ and that $A$ satisfies (i) and (ii), and let $\left\{t_{1}, \ldots, t_{r^{2}+1}\right\}$ be distinct elements of $A$, where $t_{j}=p_{1}^{\alpha_{j_{1}}} \cdot p_{2}^{\alpha_{j_{2}}} \cdots p_{r}^{\alpha_{j_{r}}}$. We shall show that the product of some elements of $A$ is a perfect $p$ th power, i.e., that there exist $\tau_{j} \in\{0,1\}\left(1 \leq j \leq r^{2}+1\right)$, not all equal to 0 , such that $T=t_{1}^{\tau_{1}} \cdot t_{2}^{\tau_{2}} \cdots t_{r^{2}+1}^{\tau_{r^{2}+1}}$ is a $p$ th power. This is equivalent to the condition that  $$ \sum_{j=1}^{r^{2}+1} \alpha_{i j} \tau_{j} \equiv 0(\bmod p) $$  holds for all $i=1, \ldots, r$. By Fermat's theorem it is sufficient to find integers $x_{1}, \ldots, x_{r^{2}+1}$, not all zero, such that the relation  $$ \sum_{j=1}^{r^{2}+1} \alpha_{i j} x_{j}^{r} \equiv 0(\bmod p) $$  is satisfied for all $i \in\{1, \ldots, r\}$. Set $F_{i}=\sum_{j=1}^{r^{2}+1} \alpha_{i j} x_{j}^{r}$. We want to find $x_{1}, \ldots, x_{r}$ such that $F_{1} \equiv F_{2} \equiv \cdots \equiv F_{r} \equiv 0(\bmod p)$, which is by Fermat's theorem equivalent to  $$ F\left(x_{1}, \ldots, x_{r}\right)=F_{1}^{r}+F_{2}^{r}+\cdots+F_{r}^{r} \equiv 0(\bmod p) . $$  Of course, one solution of (1) is $(0, \ldots, 0)$ : we are not satisfied with it because it generates the empty subset of $A$, but it tells us that (1) has at least one solution. We shall prove that the number of solutions of (1) is divisible by $p$, which will imply the existence of a nontrivial solution and thus complete the proof. To do this, consider the sum $\sum F\left(x_{1}, \ldots, x_{r^{2}+1}\right)^{r}$ taken over all vectors $\left(x_{1}, \ldots, x_{r^{2}+1}\right)$ in the vector space $\mathbb{Z}_{p}^{r^{2}+1}$. Our statement is equivalent to  $$ \sum F\left(x_{1}, \ldots, x_{r^{2}+1}\right)^{r} \equiv 0(\bmod p) $$  Since the degree of $F^{r}$ is $r^{2}$, in each monomial in $F^{r}$ at least one of the variables is missing. Consider any of these monomials, say $b x_{i_{1}}^{a_{1}} x_{i_{2}}^{a_{2}} \cdots x_{i_{k}}^{a_{k}}$. Then the sum $\sum b x_{i_{1}}^{a_{1}} x_{i_{2}}^{a_{2}} \cdots x_{i_{k}}^{a_{k}}$, taken over the set of all vectors $\left(x_{1}, \ldots, x_{r^{2}+1}\right) \in \mathbb{Z}_{p}^{r^{2}+1}$, is equal to  $$ p^{r^{2}+1-u} \cdot \sum_{\left(x_{i_{1}}, \ldots, x_{i_{k}}\right) \in \mathbb{Z}_{p}^{k}} b x_{i_{1}}^{a_{1}} x_{i_{2}}^{a_{2}} \cdots x_{i_{k}}^{a_{k}}, $$  which is divisible by $p$, so that (2) is proved. Thus the answer is $(p-1)^{2}$.


3. A3 (GEO) Consider pairs of sequences of positive real numbers $a_{1} \geq$ $a_{2} \geq a_{3} \geq \cdots, b_{1} \geq b_{2} \geq b_{3} \geq \cdots$ and the sums $A_{n}=a_{1}+\cdots+a_{n}$, $B_{n}=b_{1}+\cdots+b_{n}, n=1,2, \ldots$. For any pair define $c_{i}=\min \left\{a_{i}, b_{i}\right\}$ and $C_{n}=c_{1}+\cdots+c_{n}, n=1,2, \ldots$ (a) Does there exist a pair $\left(a_{i}\right)_{i \geq 1},\left(b_{i}\right)_{i \geq 1}$ such that the sequences $\left(A_{n}\right)_{n \geq 1}$ and $\left(B_{n}\right)_{n \geq 1}$ are unbounded while the sequence $\left(C_{n}\right)_{n \geq 1}$ is bounded? (b) Does the answer to question (1) change by assuming additionally that $b_{i}=1 / i, i=1,2, \ldots ?$ Justify your answer.

Solution: 3. (a) Given any sequence $c_{n}$ (in particular, such that $C_{n}$ converges), we shall construct $a_{n}$ and $b_{n}$ such that $A_{n}$ and $B_{n}$ diverge. First, choose $n_{1}$ such that $n_{1} c_{1}>1$ and set $a_{1}=a_{2}=\cdots=a_{n_{1}}=$ $c_{1}$ : this uniquely determines $b_{2}=c_{2}, \ldots, b_{n_{1}}=c_{n_{1}}$. Next, choose $n_{2}$ such that $\left(n_{2}-n_{1}\right) c_{n_{1}+1}>1$ and set $b_{n_{1}+1}=\cdots=b_{n_{2}}=c_{n_{1}+1}$; again $a_{n_{1}+1}, \ldots, a_{n_{2}}$ is hereby determined. Then choose $n_{3}$ with $\left(n_{3}-\right.$ $\left.n_{2}\right) c_{n_{2}+1}>1$ and set $a_{n_{2}+1}=\cdots=a_{n_{3}}=c_{n_{2}+1}$, and so on. It is plain that in this way we construct decreasing sequences $a_{n}, b_{n}$ such that $\sum a_{n}$ and $\sum b_{n}$ diverge, since they contain an infinity of subsums that exceed 1 ; on the other hand, $c_{n}=\min \left(a_{n}, b_{n}\right)$ and $C_{n}$ is convergent. (b) The answer changes in this situation. Suppose to the contrary that there is such a pair of sequences $\left(a_{n}\right)$ and $\left(b_{n}\right)$. There are infinitely many indices $i$ such that $c_{i}=b_{i}$ (otherwise all but finitely many terms of the sequence $\left(c_{n}\right)$ would be equal to the terms of the sequence $\left(a_{n}\right)$, which has an unbounded sum). Thus for any $n_{0} \in \mathbb{N}$ there is $j \geq 2 n_{0}$ such that $c_{j}=b_{j}$. Then we have  $$ \sum_{k=n_{0}}^{j} c_{k} \geq \sum_{k=n_{0}}^{j} c_{j}=\left(j-n_{0}\right) \frac{1}{j} \geq \frac{1}{2} $$  Hence the sequence ( $C_{n}$ ) is unbounded, a contradiction.


4. A4 (IRE) ${ }^{\mathrm{IMO} 5}$ Let $n$ be a positive integer and let $x_{1} \leq x_{2} \leq \cdots \leq x_{n}$ be real numbers. (a) Prove that  $$ \left(\sum_{i, j=1}^{n}\left|x_{i}-x_{j}\right|\right)^{2} \leq \frac{2\left(n^{2}-1\right)}{3} \sum_{i, j=1}^{n}\left(x_{i}-x_{j}\right)^{2} $$  (b) Show that equality holds if and only if $x_{1}, \ldots, x_{n}$ is an arithmetic progession.

Solution: 4. By the Cauchy-Schwarz inequality we have  $$ \left(\sum_{i, j=1}^{n}(i-j)^{2}\right)\left(\sum_{i, j=1}^{n}\left(x_{i}-x_{j}\right)^{2}\right) \geq\left(\sum_{i, j=1}^{n}|i-j| \cdot\left|x_{i}-x_{j}\right|\right)^{2} . $$  On the other hand, it is easy to prove (for example by induction) that  $$ \sum_{i, j=1}^{n}(i-j)^{2}=(2 n-2) \cdot 1^{2}+(2 n-4) \cdot 2^{2}+\cdots+2 \cdot(n-1)^{2}=\frac{n^{2}\left(n^{2}-1\right)}{6} $$  and that  $$ \sum_{i, j=1}^{n}|i-j| \cdot\left|x_{i}-x_{j}\right|=\frac{n}{2} \sum_{i, j=1}^{n}\left|x_{i}-x_{j}\right| $$  Thus the inequality (1) becomes  $$ \frac{n^{2}\left(n^{2}-1\right)}{6}\left(\sum_{i, j=1}^{n}\left(x_{i}-x_{j}\right)^{2}\right) \geq \frac{n^{2}}{4}\left(\sum_{i, j=1}^{n}\left|x_{i}-x_{j}\right|\right)^{2} $$  which is equivalent to the required one.


5. A5 (KOR) Let $\mathbb{R}^{+}$be the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$that satisfy the following conditions: (i) $f(x y z)+f(x)+f(y)+f(z)=f(\sqrt{x y}) f(\sqrt{y z}) f(\sqrt{z x})$ for all $x, y, z \in$ $\mathbb{R}^{+}$. (ii) $f(x)<f(y)$ for all $1 \leq x<y$.

Solution: 5. Placing $x=y=z=1$ in (i) leads to $4 f(1)=f(1)^{3}$, so by the condition $f(1)>0$ we get $f(1)=2$. Also putting $x=t s, y=\frac{t}{s}, z=\frac{s}{t}$ in (i) gives  $$ f(t) f(s)=f(t s)+f(t / s) $$  In particular, for $s=1$ the last equality yields $f(t)=f(1 / t)$; hence $f(t) \geq f(1)=2$ for each $t$. It follows that there exists $g(t) \geq 1$ such that $\bar{f}(t)=g(t)+\frac{1}{g(t)}$. Now it follows by induction from (1) that $g\left(t^{n}\right)=$ $g(t)^{n}$ for every integer $n$, and therefore $g\left(t^{q}\right)=g(t)^{q}$ for every rational $q$. Consequently, if $t>1$ is fixed, we have $f\left(t^{q}\right)=a^{q}+a^{-q}$, where $a=g(t)$. But since the set of $a^{q}(q \in \mathbb{Q})$ is dense in $\mathbb{R}^{+}$and $f$ is monotone on $(0,1]$ and $[1, \infty)$, it follows that $f\left(t^{r}\right)=a^{r}+a^{-r}$ for every real $r$. Therefore, if $k$ is such that $t^{k}=a$, we have  $$ f(x)=x^{k}+x^{-k} \quad \text { for every } x \in \mathbb{R} $$


6. A6 (USA) Let $n$ be a positive integer and let $\left(x_{1}, \ldots, x_{n}\right),\left(y_{1}, \ldots, y_{n}\right)$ be two sequences of positive real numbers. Suppose $\left(z_{2}, z_{3}, \ldots, z_{2 n}\right)$ is a sequence of positive real numbers such that  $$ z_{i+j}^{2} \geq x_{i} y_{j} \quad \text { for all } 1 \leq i, j \leq n $$  Let $M=\max \left\{z_{2}, \ldots, z_{2 n}\right\}$. Prove that  $$ \left(\frac{M+z_{2}+\cdots+z_{2 n}}{2 n}\right)^{2} \geq\left(\frac{x_{1}+\cdots+x_{n}}{n}\right)\left(\frac{y_{1}+\cdots+y_{n}}{n}\right) . $$

Solution: 6. Set $X=\max \left\{x_{1}, \ldots, x_{n}\right\}$ and $Y=\max \left\{y_{1}, \ldots, y_{n}\right\}$. By replacing $x_{i}$ by $x_{i}^{\prime}=\frac{x_{i}}{X}, y_{i}$ by $y_{i}^{\prime}=\frac{y_{i}}{Y}$ and $z_{i}$ by $z_{i}^{\prime}=\frac{z_{i}}{\sqrt{X Y}}$, we may assume that $X=Y=1$. It is sufficient to prove that  $$ M+z_{2}+\cdots+z_{2 n} \geq x_{1}+\cdots+x_{n}+y_{1}+\cdots+y_{n} $$  because this implies the result by the A-G mean inequality. To prove (1) it is enough to prove that for any $r$, the number of terms greater than $r$ on the left-hand side of (1) is at least that number on the right-hand side of (1). If $r \geq 1$, then there are no terms on the right-hand side greater than $r$. Suppose that $r<1$ and consider the sets $A=\left\{i \mid 1 \leq i \leq n, x_{i}>r\right\}$ and $B=\left\{i \mid 1 \leq i \leq n, y_{i}>r\right\}$. Set $a=|A|$ and $b=|B|$. If $x_{i}>r$ and $y_{j}>r$, then $z_{i+j} \geq \sqrt{x_{i} y_{j}}>r$; hence  $$ C=\left\{k \mid 2 \leq k \leq 2 n, z_{k}>r\right\} \supseteq A+B=\{\alpha+\beta \mid \alpha \in A, \beta \in B\} $$  It is easy to verify that $|A+B| \geq|A|+|B|-1$. It follows that the number of $z_{k}$ 's greater than $r$ is $\geq a+b-1$. But in that case $M>r$, implying that at least $a+b$ elements of the left-hand side of (1) is greater than $r$, which completes the proof.


7. C1 (BRA) ${ }^{\mathrm{IMO} 1}$ Let $A$ be a 101-element subset of the set $S=\{1,2, \ldots$, $1000000\}$. Prove that there exist numbers $t_{1}, t_{2}, \ldots, t_{100}$ in $S$ such that the sets  $$ A_{j}=\left\{x+t_{j} \mid x \in A\right\}, \quad j=1,2, \ldots, 100 $$  are pairwise disjoint.

Solution: 7. Consider the set $D=\{x-y \mid x, y \in A\}$. Obviously, the number of elements of the set $D$ is less than or equal to $101 \cdot 100+1$. The sets $A+t_{i}$ and $A+t_{j}$ are disjoint if and only if $t_{i}-t_{j} \notin D$. Now we shall choose inductively 100 elements $t_{1}, \ldots, t_{100}$. Let $t_{1}$ be any element of the set $S \backslash D$ (such an element exists, since the number of elements of $S$ is greater than the number of elements of $D$ ). Suppose now that we have chosen $k(k \leq 99)$ elements $t_{1}, \ldots, t_{k}$ from $D$ such that the difference of any two of the chosen elements does not belong to $D$. We can select $t_{k+1}$ to be an element of $S$ that does not belong to any of the sets $t_{1}+D, t_{2}+D, \ldots, t_{k}+D$ (this is possible to do, since each of the previous sets has at most $101 \cdot 100+1$ elements; hence their union has at most $99(101 \cdot 100+1)=999999<1000000$ elements $)$.


8. C2 (GEO) Let $D_{1}, \ldots, D_{n}$ be closed disks in the plane. (A closed disk is a region bounded by a circle, taken jointly with this circle.) Suppose that every point in the plane is contained in at most 2003 disks $D_{i}$. Prove that there exists disk $D_{k}$ that intersects at most $7 \cdot 2003-1$ other disks $D_{i}$.

Solution: 8. Let $S$ be the disk with the smallest radius, say $s$, and $O$ the center of that disk. Divide the plane into 7 regions: one bounded by disk $s$ and 6 regions $T_{1}, \ldots, T_{6}$ shown in the figure. Any of the disks different from $S$, say $D_{k}$, has its center in one of the seven regions. If its center is inside $S$ then $D_{k}$ contains point $O$. Hence the number of disks different from $S$ having their centers in $S$ is at most 2002.  Consider a disk $D_{k}$ that intersects $S$ and whose center is in the region $T_{i}$. Let $P_{i}$ be the point such that $O P_{i}$ bisects the region $T_{i}$ and ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-713.jpg?height=453&width=503&top_left_y=799&top_left_x=828) $O P_{i}=s \sqrt{3}$. We claim that $D_{k}$ contains $P_{i}$. Divide the region $T_{i}$ by a line $l_{i}$ through $P_{i}$ perpendicular to $O P_{i}$ into two regions $U_{i}$ and $V_{i}$, where $O$ and $U_{i}$ are on the same side of $l_{i}$. Let $K$ be the center of $D_{k}$. Consider two cases: (i) $K \in U_{i}$. Since the disk with the center $P_{i}$ and radius $s$ contains $U_{i}$, we see that $K P_{i} \leq s$. Hence $D_{k}$ contains $P_{i}$. (ii) $K \in V_{i}$. Denote by $L$ the intersection point of the segment $K O$ with the circle $s$. We want to prove that $K L>K P_{i}$. It is enough to prove that $\angle K P_{i} L>\angle K L P_{i}$. However, it is obvious that $\angle L P_{i} O \leq 30^{\circ}$ and $\angle L O P_{i} \leq 30^{\circ}$, hence $\angle K L P_{i} \leq 60^{\circ}$, while $\angle N P_{i} L=90^{\circ}-\angle L P_{i} O \geq$ $60^{\circ}$. This implies that $\angle K P_{i} L \geq \angle N P_{i} L \geq 60^{\circ} \geq \angle K L P_{i}$ ( $N$ is the point on the edge of $T_{i}$ as shown in the figure). Our claim is thus proved. Now we see that the number of disks with centers in $T_{i}$ that intersect $S$ is less than or equal to 2003, and the total number of disks that intersect $S$ is not greater than $2002+6 \cdot 2003=7 \cdot 2003-1$.


9. C3 (LIT) Let $n \geq 5$ be a given integer. Determine the largest integer $k$ for which there exists a polygon with $n$ vertices (convex or not, with non-self-intersecting boundary) having $k$ internal right angles.

Solution: 9. Suppose that $k$ of the angles of an $n$-gon are right. Since the other $n-k$ angles are less than $360^{\circ}$ and the sum of the angles is $(n-2) 180^{\circ}$, we have the inequality $k \cdot 90^{\circ}+(n-k) 360^{\circ}>(n-2) 180^{\circ}$, which is equivalent to $k<\frac{2 n+4}{3}$. Since $n$ and $k$ are integers, it follows that $k \leq\left[\frac{2 n}{3}\right]+1$. If $n=5$, then $\left[\frac{2 n}{3}\right]+1=4$, but if a pentagon has four right angles, the other angle is equal to $180^{\circ}$, which is impossible. Hence for $n=5$, $k \leq 3$. It is easy to construct a pentagon with 3 right angles, e.g., as in the picture below. Now we shall show by induction that for $n \geq 6$ there is an $n$-gon with $\left[\frac{2 n}{3}\right]+1$ internal right angles. For $n=6,7,8$ examples are presented in the picture. Assume that there is a $(n-3)$ gon with $\left[\frac{2(n-3)}{3}\right]+1=\left[\frac{2 n}{3}\right]-1$ internal right angles. Then one of the internal angles, say $\angle B A C$, is not convex. Interchange the vertex $A$ with four new vertices $A_{1}, A_{2}, A_{3}, A_{4}$ as shown in the picture such that $\angle B A_{1} A_{2}=\angle A_{3} A_{4} C=90^{\circ}$. ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-714.jpg?height=195&width=1024&top_left_y=781&top_left_x=292)


1. A1 (KOR) ${ }^{\mathrm{IMO} 4}$ Let $n \geq 3$ be an integer and $t_{1}, t_{2}, \ldots, t_{n}$ positive real numbers such that  $$ n^{2}+1>\left(t_{1}+t_{2}+\cdots+t_{n}\right)\left(\frac{1}{t_{1}}+\frac{1}{t_{2}}+\cdots+\frac{1}{t_{n}}\right) . $$  Show that $t_{i}, t_{j}, t_{k}$ are the side lengths of a triangle for all $i, j, k$ with $1 \leq i<j<k \leq n$.

Solution: 1. By symmetry, it is enough to prove that $t_{1}+t_{2}>t_{3}$. We have  $$ \left(\sum_{i=1}^{n} t_{i}\right)\left(\sum_{i=1}^{n} \frac{1}{t}_{i}\right)=n^{2}+\sum_{i<j}\left(\frac{t_{i}}{t_{j}}+\frac{t_{j}}{t_{i}}-2\right) . $$  All the summands on the RHS are positive, and therefore the RHS is not smaller than $n^{2}+T$, where $T=\left(t_{1} / t_{3}+t_{3} / t_{1}-2\right)+\left(t_{2} / t_{3}+t_{3} / t_{2}-2\right)$. We note that $T$ is increasing as a function in $t_{3}$ for $t_{3} \geq \max \left\{t_{1}, t_{2}\right\}$. If $t_{1}+t_{2}=t_{3}$, then $T=\left(t_{1}+t_{2}\right)\left(1 / t_{1}+1 / t_{2}\right)-1 \geq 3$ by the Cauchy-Schwarz inequality. Hence, if $t_{1}+t_{2} \leq t_{3}$, we have $T \geq 1$, and consequently the RHS in (1) is greater than or equal to $n^{2}+1$, a contradiction. Remark. In can be proved, for example using Lagrange multipliers, that if $n^{2}+1$ in the problem is replaced by $(n+\sqrt{10}-3)^{2}$, then the statement remains true. This estimate is the best possible.


10. C3 (AUS) The following operation is allowed on a finite graph: Choose an arbitrary cycle of length 4 (if there is any), choose an arbitrary edge in that cycle, and delete it from the graph. For a fixed integer $n \geq 4$, find the least number of edges of a graph that can be obtained by repeated applications of this operation from the complete graph on $n$ vertices (where each pair of vertices are joined by an edge).

Solution: 10. The least number of edges of such a graph is $n$.  We note that deleting edge $A B$ of a 4-cycle $A B C D$ from a connected and nonbipartite graph $G$ yields a connected and nonbipartite graph, say $H$. Indeed, the connectedness is obvious; also, if $H$ were bipartite with partition of the set of vertices into $P_{1}$ and $P_{2}$, then w.l.o.g. $A, C \in P_{1}$ and $B, D \in P_{2}$, so $G=H \cup\{A B\}$ would also be bipartite with the same partition, a contradiction. Any graph that can be obtained from the complete $n$-graph in the described way is connected and has at least one cycle (otherwise it would be bipartite); hence it must have at least $n$ edges. Now consider a complete graph with vertices $V_{1}, V_{2}, \ldots, V_{n}$. Let us remove every edge $V_{i} V_{j}$ with $3 \leq i<j<n$ from the cycle $V_{2} V_{i} V_{j} V_{n}$. Then for $i=3, \ldots, n-1$ we remove edges $V_{2} V_{i}$ and $V_{i} V_{n}$ from the cycles $V_{1} V_{i} V_{2} V_{n}$ and $V_{1} V_{i} V_{n} V_{2}$ respectively, thus obtaining a graph with exactly $n$ edges: $V_{1} V_{i}(i=2, \ldots, n)$ and $V_{2} V_{n}$.


11. C4 (POL) Consider a matrix of size $n \times n$ whose entries are real numbers of absolute value not exceeding 1 , and the sum of all entries is 0 . Let $n$ be an even positive integer. Determine the least number $C$ such that every such matrix necessarily has a row or a column with the sum of its entries not exceeding $C$ in absolute value.

Solution: 11. Consider the matrix $A=\left(a_{i j}\right)_{i, j=1}^{n}$ such that $a_{i j}$ is equal to 1 if $i, j \leq n / 2$, -1 if $i, j>n / 2$, and 0 otherwise. This matrix satisfies the conditions from the problem and all row sums and column sums are equal to $\pm n / 2$. Hence $C \geq n / 2$. Let us show that $C=n / 2$. Assume to the contrary that there is a matrix $B=\left(b_{i j}\right)_{i, j=1}^{n}$ all of whose row sums and column sums are either greater than $n / 2$ or smaller than $-n / 2$. We may assume w.l.o.g. that at least $n / 2$ row sums are positive and, permuting rows if necessary, that the first $n / 2$ rows have positive sums. The sum of entries in the $n / 2 \times n$ submatrix $B^{\prime}$ consisting of first $n / 2$ rows is greater than $n^{2} / 4$, and since each column of $B^{\prime}$ has sum at most $n / 2$, it follows that more than $n / 2$ column sums of $B^{\prime}$, and therefore also of $B$, are positive. Again, suppose w.l.o.g. that the first $n / 2$ column sums are positive. Thus the sums $R^{+}$and $C^{+}$of entries in the first $n / 2$ rows and in the first $n / 2$ columns respectively are greater than $n^{2} / 4$. Now the sum of all entries of $B$ can be written as  $$ \sum a_{i j}=R^{+}+C^{+}+\sum_{\substack{i>n / 2 \\ j>n / 2}} a_{i j}-\sum_{\substack{i \leq n / 2 \\ j \leq n / 2}} a_{i j}>\frac{n^{2}}{2}-\frac{n^{2}}{4}-\frac{n^{2}}{4}=0 $$  a contradiction. Hence $C=n / 2$, as claimed.


12. C5 (NZL) Let $N$ be a positive integer. Two players $A$ and $B$, taking turns, write numbers from the set $\{1, \ldots, N\}$ on a blackboard. $A$ begins the game by writing 1 on his first move. Then, if a player has written $n$ on a certain move, his adversary is allowed to write $n+1$ or $2 n$ (provided the number he writes does not exceed $N$ ). The player who writes $N$ wins. We say that $N$ is of type $A$ or of type $B$ according as $A$ or $B$ has a winning strategy. (a) Determine whether $N=2004$ is of type $A$ or of type $B$. (b) Find the least $N>2004$ whose type is different from that of 2004.

Solution: 12. We say that a number $n \in\{1,2, \ldots, N\}$ is winning if the player who is on turn has a winning strategy, and losing otherwise. The game is of type $A$ if and only if 1 is a losing number. Let us define $n_{0}=N, n_{i+1}=\left[n_{i} / 2\right]$ for $i=0,1, \ldots$ and let $k$ be such that $n_{k}=1$. Consider the sets $A_{i}=\left\{n_{i+1}+1, \ldots, n_{i}\right\}$. We call a set $A_{i}$ all-winning if all numbers from $A_{i}$ are winning, even-winning if even numbers are winning and odd are losing, and odd-winning if odd numbers are winning and even are losing. (i) Suppose $A_{i}$ is even-winning and consider $A_{i+1}$. Multiplying any number from $A_{i+1}$ by 2 yields an even number from $A_{i}$, which is a losing number. Thus $x \in A_{i+1}$ is winning if and only if $x+1$ is losing, i.e., if and only if it is even. Hence $A_{i+1}$ is also even-winning. (ii) Suppose $A_{i}$ is odd-winning. Then each $k \in A_{i+1}$ is winning, since $2 k$ is losing. Hence $A_{i+1}$ is all-winning. (iii) Suppose $A_{i}$ is all-winning. Multiplying $x \in A_{i+1}$ by two is then a losing move, so $x$ is winning if and only if $x+1$ is losing. Since $n_{i+1}$ is losing, $A_{i+1}$ is odd-winning if $n_{i+1}$ is even and even-winning otherwise. We observe that $A_{0}$ is even-winning if $N$ is odd and odd-winning otherwise. Also, if some $A_{i}$ is even-winning, then all $A_{i+1}, A_{i+2}, \ldots$ are evenwinning and thus 1 is losing; i.e., the game is of type $A$. The game is of type $B$ if and only if the sets $A_{0}, A_{1}, \ldots$ are alternately odd-winning and allwinning with $A_{0}$ odd-winning, which is equivalent to $N=n_{0}, n_{2}, n_{4}, \ldots$ all being even. Thus $N$ is of type $B$ if and only if all digits at the odd positions in the binary representation of $N$ are zeros. Since $2004=\overline{11111010100}$ in the binary system, 2004 is of type $A$. The least $N>2004$ that is of type $B$ is $\overline{100000000000}=2^{11}=2048$. Thus the answer to part (b) is 2048.


13. C6 (IRN) For an $n \times n$ matrix $A$, let $X_{i}$ be the set of entries in row $i$, and $Y_{j}$ the set of entries in column $j, 1 \leq i, j \leq n$. We say that $A$ is golden if $X_{1}, \ldots, X_{n}, Y_{1}, \ldots, Y_{n}$ are distinct sets. Find the least integer $n$ such that there exists a $2004 \times 2004$ golden matrix with entries in the set $\{1,2, \ldots, n\}$.

Solution: 13. Since $X_{i}, Y_{i}, i=1, \ldots, 2004$, are 4008 distinct subsets of the set $S_{n}=$ $\{1,2, \ldots, n\}$, it follows that $2^{n} \geq 4008$, i.e. $n \geq 12$. Suppose $n=12$. Let $\mathcal{X}=\left\{X_{1}, \ldots, X_{2004}\right\}, \mathcal{Y}=\left\{Y_{1}, \ldots, Y_{2004}\right\}, \mathcal{A}=$ $\mathcal{X} \cup \mathcal{Y}$. Exactly $2^{12}-4008=88$ subsets of $S_{n}$ do not occur in $\mathcal{A}$. Since each row intersects each column, we have $X_{i} \cap Y_{j} \neq \emptyset$ for all $i, j$. Suppose $\left|X_{i}\right|,\left|Y_{j}\right| \leq 3$ for some indices $i, j$. Since then $\left|X_{i} \cup Y_{j}\right| \leq 5$, any of at least $2^{7}>88$ subsets of $S_{n} \backslash\left(X_{i} \cap Y_{j}\right)$ can occur in neither $\mathcal{X}$ nor $\mathcal{Y}$, which is impossible. Hence either in $\mathcal{X}$ or in $\mathcal{Y}$ all subsets are of size at least 4. Suppose w.l.o.g. that $k=\left|X_{l}\right|=\min _{i}\left|X_{i}\right| \geq 4$. There are  $$ n_{k}=\binom{12-k}{0}+\binom{12-k}{1}+\cdots+\binom{12-k}{k-1} $$  subsets of $S \backslash X_{l}$ with fewer than $k$ elements, and none of them can be either in $\mathcal{X}$ (because $\left|X_{l}\right|$ is minimal in $\mathcal{X}$ ) or in $\mathcal{Y}$. Hence we must have $n_{k} \leq 88$. Since $n_{4}=93$ and $n_{5}=99$, it follows that $k \geq 6$. But then none of the $\binom{12}{0}+\cdots+\binom{12}{5}=1586$ subsets of $S_{n}$ is in $\mathcal{X}$, hence at least $1586-88=1498$ of them are in $\mathcal{Y}$. The 1498 complements of these subsets also do not occur in $\mathcal{X}$, which adds to 3084 subsets of $S_{n}$ not occurring in $\mathcal{X}$. This is clearly a contradiction. Now we construct a golden matrix for $n=13$. Let  $$ A_{1}=\left[\begin{array}{ll} 1 & 1 \\ 2 & 3 \end{array}\right] \quad \text { and } \quad A_{m}=\left[\begin{array}{ll} A_{m-1} & A_{m-1} \\ A_{m-1} & B_{m-1} \end{array}\right] \text { for } m=2,3, \ldots $$  where $B_{m-1}$ is the $2^{m-1} \times 2^{m-1}$ matrix with all entries equal to $m+2$. It can be easily proved by induction that each of the matrices $A_{m}$ is golden. Moreover, every upper-left square submatrix of $A_{m}$ of size greater than $2^{m-1}$ is also golden. Since $2^{10}<2004<2^{11}$, we thus obtain a golden matrix of size 2004 with entries in $S_{13}$.


14. C7 (EST) ${ }^{\mathrm{IMO} 3}$ Determine all $m \times n$ rectangles that can be covered with hooks made up of 6 unit squares, as in the figure: ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-338.jpg?height=153&width=150&top_left_y=1988&top_left_x=722)  Rotations and reflections of hooks are allowed. The rectangle must be covered without gaps and overlaps. No part of a hook may cover area outside the rectangle.

Solution: 14. Suppose that an $m \times n$ rectangle can be covered by "hooks". For any hook $H$ there is a unique hook $K$ that covers its " inside" square. Then also $H$ covers the inside square of $K$, so the set of hooks can be partitioned into pairs of type $\{H, K\}$, each of which forms one of the following two figures consisting of 12 squares: ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-730.jpg?height=252&width=979&top_left_y=972&top_left_x=306)  Thus the $m \times n$ rectangle is covered by these tiles. It immediately follows that $12 \mid \mathrm{mn}$. Suppose one of $m, n$ is divisible by 4 . Let w.l.o.g. $4 \mid m$. If $3 \mid n$, one can easily cover the rectangle by $3 \times 4$ rectangles and therefore by hooks. Also, if $12 \mid m$ and $n \notin\{1,2,5\}$, then there exist $k, l \in \mathbb{N}_{0}$ such that $n=3 k+4 l$, and thus the rectangle $m \times n$ can be partitioned into $3 \times 12$ and $4 \times 12$ rectangles all of which can be covered by hooks. If $12 \mid m$ and $n=1,2$, or 5 , then it is easy to see that covering by hooks is not possible. Now suppose that $4 \nmid m$ and $4 \nmid n$. Then $m, n$ are even and the number of tiles is odd. Assume that the total number of tiles of types $A_{1}$ and $B_{1}$ is odd (otherwise the total number of tiles of types $A_{2}$ and $B_{2}$ is odd, which is analogous). If we color in black all columns whose indices are divisible by 4 , we see that each tile of type $A_{1}$ or $B_{1}$ covers three black squares, which yields an odd number in total. Hence the total number of black squares covered by the tiles of types $A_{2}$ and $B_{2}$ must be odd. This is impossible, since each such tile covers two or four black squares.


15. C8 (POL) For a finite graph $G$, let $f(G)$ be the number of triangles and $g(G)$ the number of tetrahedra formed by edges of $G$. Find the least constant $c$ such that  $$ g(G)^{3} \leq c \cdot f(G)^{4} \text { for every graph } G $$

Solution: 15. Denote by $V_{1}, \ldots, V_{n}$ the vertices of a graph $G$ and by $E$ the set of its edges. For each $i=1, \ldots, n$, let $A_{i}$ be the set of vertices connected to $V_{i}$ by an edge, $G_{i}$ the subgraph of $G$ whose set of vertices is $A_{i}$, and $E_{i}$ the set of edges of $G_{i}$. Also, let $v_{i}, e_{i}$, and $t_{i}=f\left(G_{i}\right)$ be the numbers of vertices, edges, and triangles in $G_{i}$ respectively.  The numbers of tetrahedra and triangles one of whose vertices is $V_{i}$ are respectively equal to $t_{i}$ and $e_{i}$. Hence  $$ \sum_{i=1}^{n} v_{i}=2|E|, \quad \sum_{i=1}^{n} e_{i}=3 f(G) \quad \text { and } \quad \sum_{i=1}^{n} t_{i}=4 g(G) . $$  Since $e_{i} \leq v_{i}\left(v_{i}-1\right) / 2 \leq v_{i}^{2} / 2$ and $e_{i} \leq|E|$, we obtain $e_{i}^{2} \leq v_{i}^{2}|E| / 2$, i.e., $e_{i} \leq v_{i} \sqrt{|E| / 2}$. Summing over all $i$ yields $3 f(G) \leq 2|E| \sqrt{|E| / 2}$, or equivalently $f(G)^{2} \leq 2|E|^{3} / 9$. Since this relation holds for each graph $G_{i}$, it follows that  $$ t_{i}=f\left(G_{i}\right)=f\left(G_{i}\right)^{1 / 3} f\left(G_{i}\right)^{2 / 3} \leq\left(\frac{2}{9}\right)^{1 / 3} f(G)^{1 / 3} e_{i} $$  Summing the last inequality for $i=1, \ldots, n$ gives us  $$ 4 g(G) \leq 3\left(\frac{2}{9}\right)^{1 / 3} f(G)^{1 / 3} \cdot f(G), \quad \text { i.e. } \quad g(G)^{3} \leq \frac{3}{32} f(G)^{4} $$  The constant $c=3 / 32$ is the best possible. Indeed, in a complete graph $C_{n}$ it holds that $g\left(K_{n}\right)^{3} / f\left(K_{n}\right)^{4}=\binom{n}{4}^{3}\binom{n}{3}^{-4} \rightarrow \frac{3}{32}$ as $n \rightarrow \infty$. Remark. Let $N_{k}$ be the number of complete $k$-subgraphs in a finite graph $G$. Continuing inductively, one can prove that $N_{k+1}^{k} \leq \frac{k!}{(k+1)^{k}} N_{k}^{k+1}$.


16. G1 (ROM) ${ }^{\mathrm{IMO} 1}$ Let $A B C$ be an acute-angled triangle with $A B \neq A C$. The circle with diameter $B C$ intersects the sides $A B$ and $A C$ at $M$ and $N$, respectively. Denote by $O$ the midpoint of $B C$. The bisectors of the angles $B A C$ and $M O N$ intersect at $R$. Prove that the circumcircles of the triangles $B M R$ and $C N R$ have a common point lying on the line segment $B C$.

Solution: 16. Note that $\triangle A N M \sim \triangle A B C$ and consequently $A M \neq A N$. Since $O M=$ $O N$, it follows that $O R$ is a perpendicular bisector of $M N$. Thus, $R$ is the common point of the median of $M N$ and the bisector of $\angle M A N$. Then it follows from a well-known fact that $R$ lies on the circumcircle of $\triangle A M N$. Let $K$ be the intersection of $A R$ and $B C$. We then have $\angle M R A=$ $\angle M N A=\angle A B K$ and $\angle N R A=\angle N M A=\angle A C K$, from which we conclude that $R M B K$ and $R N C K$ are cyclic. Thus $K$ is the desired intersection of the circumcircles of $\triangle B M R$ and $\triangle C N R$ and it indeed lies on $B C$.