Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that the equality  $$ f([x] y)=f(x)[f(y)] . $$  holds for all $x, y \in \mathbb{R}$. Here, by $[x]$ we denote the greatest integer not exceeding $x$. (France) Answer. $f(x)=$ const $=C$, where $C=0$ or $1 \leq C<2$.

Solution: First, setting $x=0$ in (1) we get  $$ f(0)=f(0)[f(y)] $$  for all $y \in \mathbb{R}$. Now, two cases are possible. Case 1. Assume that $f(0) \neq 0$. Then from (2) we conclude that $[f(y)]=1$ for all $y \in \mathbb{R}$. Therefore, equation (1) becomes $f([x] y)=f(x)$, and substituting $y=0$ we have $f(x)=f(0)=C \neq 0$. Finally, from $[f(y)]=1=[C]$ we obtain that $1 \leq C<2$.  Case 2. Now we have $f(0)=0$. Here we consider two subcases. Subcase 2a. Suppose that there exists $0<\alpha<1$ such that $f(\alpha) \neq 0$. Then setting $x=\alpha$ in (1) we obtain $0=f(0)=f(\alpha)[f(y)]$ for all $y \in \mathbb{R}$. Hence, $[f(y)]=0$ for all $y \in \mathbb{R}$. Finally, substituting $x=1$ in (1) provides $f(y)=0$ for all $y \in \mathbb{R}$, thus contradicting the condition $f(\alpha) \neq 0$.  Subcase 2b. Conversely, we have $f(\alpha)=0$ for all $0 \leq \alpha<1$. Consider any real $z$; there exists an integer $N$ such that $\alpha=\frac{z}{N} \in[0,1)$ (one may set $N=[z]+1$ if $z \geq 0$ and $N=[z]-1$ otherwise). Now, from (1) we get $f(z)=f([N] \alpha)=f(N)[f(\alpha)]=0$ for all $z \in \mathbb{R}$.  Finally, a straightforward check shows that all the obtained functions satisfy (1).


Solution: Assume that $[f(y)]=0$ for some $y$; then the substitution $x=1$ provides $f(y)=f(1)[f(y)]=0$. Hence, if $[f(y)]=0$ for all $y$, then $f(y)=0$ for all $y$. This function obviously satisfies the problem conditions.  So we are left to consider the case when $[f(a)] \neq 0$ for some $a$. Then we have  $$ f([x] a)=f(x)[f(a)], \quad \text { or } \quad f(x)=\frac{f([x] a)}{[f(a)]} . $$  This means that $f\left(x_{1}\right)=f\left(x_{2}\right)$ whenever $\left[x_{1}\right]=\left[x_{2}\right]$, hence $f(x)=f([x])$, and we may assume that $a$ is an integer.  Now we have  $$ f(a)=f\left(2 a \cdot \frac{1}{2}\right)=f(2 a)\left[f\left(\frac{1}{2}\right)\right]=f(2 a)[f(0)] $$  this implies $[f(0)] \neq 0$, so we may even assume that $a=0$. Therefore equation (3) provides  $$ f(x)=\frac{f(0)}{[f(0)]}=C \neq 0 $$  for each $x$. Now, condition (1) becomes equivalent to the equation $C=C[C]$ which holds exactly when $[C]=1$.


Let the real numbers $a, b, c, d$ satisfy the relations $a+b+c+d=6$ and $a^{2}+b^{2}+c^{2}+d^{2}=12$. Prove that  $$ 36 \leq 4\left(a^{3}+b^{3}+c^{3}+d^{3}\right)-\left(a^{4}+b^{4}+c^{4}+d^{4}\right) \leq 48 $$  (Ukraine)

Solution: Observe that  $$ \begin{gathered} 4\left(a^{3}+b^{3}+c^{3}+d^{3}\right)-\left(a^{4}+b^{4}+c^{4}+d^{4}\right)=-\left((a-1)^{4}+(b-1)^{4}+(c-1)^{4}+(d-1)^{4}\right) \\ +6\left(a^{2}+b^{2}+c^{2}+d^{2}\right)-4(a+b+c+d)+4 \\ =-\left((a-1)^{4}+(b-1)^{4}+(c-1)^{4}+(d-1)^{4}\right)+52 \end{gathered} $$  Now, introducing $x=a-1, y=b-1, z=c-1, t=d-1$, we need to prove the inequalities  $$ 16 \geq x^{4}+y^{4}+z^{4}+t^{4} \geq 4 $$  under the constraint  $$ x^{2}+y^{2}+z^{2}+t^{2}=\left(a^{2}+b^{2}+c^{2}+d^{2}\right)-2(a+b+c+d)+4=4 $$  (we will not use the value of $x+y+z+t$ though it can be found). Now the rightmost inequality in (1) follows from the power mean inequality:  $$ x^{4}+y^{4}+z^{4}+t^{4} \geq \frac{\left(x^{2}+y^{2}+z^{2}+t^{2}\right)^{2}}{4}=4 . $$  For the other one, expanding the brackets we note that  $$ \left(x^{2}+y^{2}+z^{2}+t^{2}\right)^{2}=\left(x^{4}+y^{4}+z^{4}+t^{4}\right)+q $$  where $q$ is a nonnegative number, so  $$ x^{4}+y^{4}+z^{4}+t^{4} \leq\left(x^{2}+y^{2}+z^{2}+t^{2}\right)^{2}=16 $$  and we are done. Comment 1. The estimates are sharp; the lower and upper bounds are attained at $(3,1,1,1)$ and $(0,2,2,2)$, respectively. Comment 2. After the change of variables, one can finish the solution in several different ways. The latter estimate, for instance, it can be performed by moving the variables - since we need only the second of the two shifted conditions.


Solution: First, we claim that $0 \leq a, b, c, d \leq 3$. Actually, we have  $$ a+b+c=6-d, \quad a^{2}+b^{2}+c^{2}=12-d^{2} $$  hence the power mean inequality  $$ a^{2}+b^{2}+c^{2} \geq \frac{(a+b+c)^{2}}{3} $$  rewrites as  $$ 12-d^{2} \geq \frac{(6-d)^{2}}{3} \quad \Longleftrightarrow \quad 2 d(d-3) \leq 0 $$  which implies the desired inequalities for $d$; since the conditions are symmetric, we also have the same estimate for the other variables.  Now, to prove the rightmost inequality, we use the obvious inequality $x^{2}(x-2)^{2} \geq 0$ for each real $x$; this inequality rewrites as $4 x^{3}-x^{4} \leq 4 x^{2}$. It follows that  $$ \left(4 a^{3}-a^{4}\right)+\left(4 b^{3}-b^{4}\right)+\left(4 c^{3}-c^{4}\right)+\left(4 d^{3}-d^{4}\right) \leq 4\left(a^{2}+b^{2}+c^{2}+d^{2}\right)=48 $$  as desired. Now we prove the leftmost inequality in an analogous way. For each $x \in[0,3]$, we have $(x+1)(x-1)^{2}(x-3) \leq 0$ which is equivalent to $4 x^{3}-x^{4} \geq 2 x^{2}+4 x-3$. This implies that $\left(4 a^{3}-a^{4}\right)+\left(4 b^{3}-b^{4}\right)+\left(4 c^{3}-c^{4}\right)+\left(4 d^{3}-d^{4}\right) \geq 2\left(a^{2}+b^{2}+c^{2}+d^{2}\right)+4(a+b+c+d)-12=36$, as desired.  Comment. It is easy to guess the extremal points $(0,2,2,2)$ and $(3,1,1,1)$ for this inequality. This provides a method of finding the polynomials used in Solution 2. Namely, these polynomials should have the form $x^{4}-4 x^{3}+a x^{2}+b x+c$; moreover, the former polynomial should have roots at 2 (with an even multiplicity) and 0 , while the latter should have roots at 1 (with an even multiplicity) and 3 . These conditions determine the polynomials uniquely.


Solution: First, expanding $48=4\left(a^{2}+b^{2}+c^{2}+d^{2}\right)$ and applying the AM-GM inequality, we have  $$ \begin{aligned} a^{4}+b^{4}+c^{4}+d^{4}+48 & =\left(a^{4}+4 a^{2}\right)+\left(b^{4}+4 b^{2}\right)+\left(c^{4}+4 c^{2}\right)+\left(d^{4}+4 d^{2}\right) \\ & \geq 2\left(\sqrt{a^{4} \cdot 4 a^{2}}+\sqrt{b^{4} \cdot 4 b^{2}}+\sqrt{c^{4} \cdot 4 c^{2}}+\sqrt{d^{4} \cdot 4 d^{2}}\right) \\ & =4\left(\left|a^{3}\right|+\left|b^{3}\right|+\left|c^{3}\right|+\left|d^{3}\right|\right) \geq 4\left(a^{3}+b^{3}+c^{3}+d^{3}\right) \end{aligned} $$  which establishes the rightmost inequality. To prove the leftmost inequality, we first show that $a, b, c, d \in[0,3]$ as in the previous solution. Moreover, we can assume that $0 \leq a \leq b \leq c \leq d$. Then we have $a+b \leq b+c \leq$ $\frac{2}{3}(b+c+d) \leq \frac{2}{3} \cdot 6=4$.  Next, we show that $4 b-b^{2} \leq 4 c-c^{2}$. Actually, this inequality rewrites as $(c-b)(b+c-4) \leq 0$, which follows from the previous estimate. The inequality $4 a-a^{2} \leq 4 b-b^{2}$ can be proved analogously.  Further, the inequalities $a \leq b \leq c$ together with $4 a-a^{2} \leq 4 b-b^{2} \leq 4 c-c^{2}$ allow us to apply the Chebyshev inequality obtaining  $$ \begin{aligned} a^{2}\left(4 a-a^{2}\right)+b^{2}\left(4 b-b^{2}\right)+c^{2}\left(4 c-c^{2}\right) & \geq \frac{1}{3}\left(a^{2}+b^{2}+c^{2}\right)\left(4(a+b+c)-\left(a^{2}+b^{2}+c^{2}\right)\right) \\ & =\frac{\left(12-d^{2}\right)\left(4(6-d)-\left(12-d^{2}\right)\right)}{3} . \end{aligned} $$  This implies that  $$ \begin{aligned} \left(4 a^{3}-a^{4}\right) & +\left(4 b^{3}-b^{4}\right)+\left(4 c^{3}-c^{4}\right)+\left(4 d^{3}-d^{4}\right) \geq \frac{\left(12-d^{2}\right)\left(d^{2}-4 d+12\right)}{3}+4 d^{3}-d^{4} \\ & =\frac{144-48 d+16 d^{3}-4 d^{4}}{3}=36+\frac{4}{3}(3-d)(d-1)\left(d^{2}-3\right) \end{aligned} $$  Finally, we have $d^{2} \geq \frac{1}{4}\left(a^{2}+b^{2}+c^{2}+d^{2}\right)=3$ (which implies $d>1$ ); so, the expression $\frac{4}{3}(3-d)(d-1)\left(d^{2}-3\right)$ in the right-hand part of $(2)$ is nonnegative, and the desired inequality is proved. Comment. The rightmost inequality is easier than the leftmost one. In particular, Solutions 2 and 3 show that only the condition $a^{2}+b^{2}+c^{2}+d^{2}=12$ is needed for the former one.


Let $x_{1}, \ldots, x_{100}$ be nonnegative real numbers such that $x_{i}+x_{i+1}+x_{i+2} \leq 1$ for all $i=1, \ldots, 100$ (we put $x_{101}=x_{1}, x_{102}=x_{2}$ ). Find the maximal possible value of the sum  $$ S=\sum_{i=1}^{100} x_{i} x_{i+2} $$  (Russia) Answer. $\frac{25}{2}$.

Solution: Let $x_{2 i}=0, x_{2 i-1}=\frac{1}{2}$ for all $i=1, \ldots, 50$. Then we have $S=50 \cdot\left(\frac{1}{2}\right)^{2}=\frac{25}{2}$. So, we are left to show that $S \leq \frac{25}{2}$ for all values of $x_{i}$ 's satisfying the problem conditions.  Consider any $1 \leq i \leq 50$. By the problem condition, we get $x_{2 i-1} \leq 1-x_{2 i}-x_{2 i+1}$ and $x_{2 i+2} \leq 1-x_{2 i}-x_{2 i+1}$. Hence by the AM-GM inequality we get  $$ \begin{aligned} x_{2 i-1} x_{2 i+1} & +x_{2 i} x_{2 i+2} \leq\left(1-x_{2 i}-x_{2 i+1}\right) x_{2 i+1}+x_{2 i}\left(1-x_{2 i}-x_{2 i+1}\right) \\ & =\left(x_{2 i}+x_{2 i+1}\right)\left(1-x_{2 i}-x_{2 i+1}\right) \leq\left(\frac{\left(x_{2 i}+x_{2 i+1}\right)+\left(1-x_{2 i}-x_{2 i+1}\right)}{2}\right)^{2}=\frac{1}{4} \end{aligned} $$  Summing up these inequalities for $i=1,2, \ldots, 50$, we get the desired inequality  $$ \sum_{i=1}^{50}\left(x_{2 i-1} x_{2 i+1}+x_{2 i} x_{2 i+2}\right) \leq 50 \cdot \frac{1}{4}=\frac{25}{2} $$  Comment. This solution shows that a bit more general fact holds. Namely, consider $2 n$ nonnegative numbers $x_{1}, \ldots, x_{2 n}$ in a row (with no cyclic notation) and suppose that $x_{i}+x_{i+1}+x_{i+2} \leq 1$ for all $i=1,2, \ldots, 2 n-2$. Then $\sum_{i=1}^{2 n-2} x_{i} x_{i+2} \leq \frac{n-1}{4}$.  The proof is the same as above, though if might be easier to find it (for instance, applying induction). The original estimate can be obtained from this version by considering the sequence $x_{1}, x_{2}, \ldots, x_{100}, x_{1}, x_{2}$.


Solution: We present another proof of the estimate. From the problem condition, we get  $$ \begin{aligned} S=\sum_{i=1}^{100} x_{i} x_{i+2} \leq \sum_{i=1}^{100} x_{i}\left(1-x_{i}-x_{i+1}\right) & =\sum_{i=1}^{100} x_{i}-\sum_{i=1}^{100} x_{i}^{2}-\sum_{i=1}^{100} x_{i} x_{i+1} \\ & =\sum_{i=1}^{100} x_{i}-\frac{1}{2} \sum_{i=1}^{100}\left(x_{i}+x_{i+1}\right)^{2} \end{aligned} $$  By the AM-QM inequality, we have $\sum\left(x_{i}+x_{i+1}\right)^{2} \geq \frac{1}{100}\left(\sum\left(x_{i}+x_{i+1}\right)\right)^{2}$, so  $$ \begin{aligned} S \leq \sum_{i=1}^{100} x_{i}-\frac{1}{200}\left(\sum_{i=1}^{100}\left(x_{i}+x_{i+1}\right)\right)^{2} & =\sum_{i=1}^{100} x_{i}-\frac{2}{100}\left(\sum_{i=1}^{100} x_{i}\right)^{2} \\ & =\frac{2}{100}\left(\sum_{i=1}^{100} x_{i}\right)\left(\frac{100}{2}-\sum_{i=1}^{100} x_{i}\right) \end{aligned} $$  And finally, by the AM-GM inequality  $$ S \leq \frac{2}{100} \cdot\left(\frac{1}{2}\left(\sum_{i=1}^{100} x_{i}+\frac{100}{2}-\sum_{i=1}^{100} x_{i}\right)\right)^{2}=\frac{2}{100} \cdot\left(\frac{100}{4}\right)^{2}=\frac{25}{2} $$  Comment. These solutions are not as easy as they may seem at the first sight. There are two different optimal configurations in which the variables have different values, and not all of sums of three consecutive numbers equal 1. Although it is easy to find the value $\frac{25}{2}$, the estimates must be done with care to preserve equality in the optimal configurations.


A sequence $x_{1}, x_{2}, \ldots$ is defined by $x_{1}=1$ and $x_{2 k}=-x_{k}, x_{2 k-1}=(-1)^{k+1} x_{k}$ for all $k \geq 1$. Prove that $x_{1}+x_{2}+\cdots+x_{n} \geq 0$ for all $n \geq 1$. (Austria)

Solution: We start with some observations. First, from the definition of $x_{i}$ it follows that for each positive integer $k$ we have  $$ x_{4 k-3}=x_{2 k-1}=-x_{4 k-2} \quad \text { and } \quad x_{4 k-1}=x_{4 k}=-x_{2 k}=x_{k} $$  Hence, denoting $S_{n}=\sum_{i=1}^{n} x_{i}$, we have  $$ \begin{gathered} S_{4 k}=\sum_{i=1}^{k}\left(\left(x_{4 k-3}+x_{4 k-2}\right)+\left(x_{4 k-1}+x_{4 k}\right)\right)=\sum_{i=1}^{k}\left(0+2 x_{k}\right)=2 S_{k}, \\ S_{4 k+2}=S_{4 k}+\left(x_{4 k+1}+x_{4 k+2}\right)=S_{4 k} . \end{gathered} $$  Observe also that $S_{n}=\sum_{i=1}^{n} x_{i} \equiv \sum_{i=1}^{n} 1=n(\bmod 2)$. Now we prove by induction on $k$ that $S_{i} \geq 0$ for all $i \leq 4 k$. The base case is valid since $x_{1}=x_{3}=x_{4}=1, x_{2}=-1$. For the induction step, assume that $S_{i} \geq 0$ for all $i \leq 4 k$. Using the relations (1)-(3), we obtain  $$ S_{4 k+4}=2 S_{k+1} \geq 0, \quad S_{4 k+2}=S_{4 k} \geq 0, \quad S_{4 k+3}=S_{4 k+2}+x_{4 k+3}=\frac{S_{4 k+2}+S_{4 k+4}}{2} \geq 0 $$  So, we are left to prove that $S_{4 k+1} \geq 0$. If $k$ is odd, then $S_{4 k}=2 S_{k} \geq 0$; since $k$ is odd, $S_{k}$ is odd as well, so we have $S_{4 k} \geq 2$ and hence $S_{4 k+1}=S_{4 k}+x_{4 k+1} \geq 1$.  Conversely, if $k$ is even, then we have $x_{4 k+1}=x_{2 k+1}=x_{k+1}$, hence $S_{4 k+1}=S_{4 k}+x_{4 k+1}=$ $2 S_{k}+x_{k+1}=S_{k}+S_{k+1} \geq 0$. The step is proved.


Solution: We will use the notation of $S_{n}$ and the relations (1)-(3) from the previous solution.  Assume the contrary and consider the minimal $n$ such that $S_{n+1}<0$; surely $n \geq 1$, and from $S_{n} \geq 0$ we get $S_{n}=0, x_{n+1}=-1$. Hence, we are especially interested in the set $M=\left\{n: S_{n}=0\right\}$; our aim is to prove that $x_{n+1}=1$ whenever $n \in M$ thus coming to a contradiction.  For this purpose, we first describe the set $M$ inductively. We claim that (i) $M$ consists only of even numbers, (ii) $2 \in M$, and (iii) for every even $n \geq 4$ we have $n \in M \Longleftrightarrow[n / 4] \in M$. Actually, (i) holds since $S_{n} \equiv n(\bmod 2)$, (ii) is straightforward, while (iii) follows from the relations $S_{4 k+2}=S_{4 k}=2 S_{k}$.  Now, we are left to prove that $x_{n+1}=1$ if $n \in M$. We use the induction on $n$. The base case is $n=2$, that is, the minimal element of $M$; here we have $x_{3}=1$, as desired.  For the induction step, consider some $4 \leq n \in M$ and let $m=[n / 4] \in M$; then $m$ is even, and $x_{m+1}=1$ by the induction hypothesis. We prove that $x_{n+1}=x_{m+1}=1$. If $n=4 m$ then we have $x_{n+1}=x_{2 m+1}=x_{m+1}$ since $m$ is even; otherwise, $n=4 m+2$, and $x_{n+1}=-x_{2 m+2}=x_{m+1}$, as desired. The proof is complete.  Comment. Using the inductive definition of set $M$, one can describe it explicitly. Namely, $M$ consists exactly of all positive integers not containing digits 1 and 3 in their 4 -base representation.


Denote by $\mathbb{Q}^{+}$the set of all positive rational numbers. Determine all functions $f: \mathbb{Q}^{+} \rightarrow \mathbb{Q}^{+}$ which satisfy the following equation for all $x, y \in \mathbb{Q}^{+}$:  $$ f\left(f(x)^{2} y\right)=x^{3} f(x y) $$  (Switzerland) Answer. The only such function is $f(x)=\frac{1}{x}$.

Solution: By substituting $y=1$, we get  $$ f\left(f(x)^{2}\right)=x^{3} f(x) $$  Then, whenever $f(x)=f(y)$, we have  $$ x^{3}=\frac{f\left(f(x)^{2}\right)}{f(x)}=\frac{f\left(f(y)^{2}\right)}{f(y)}=y^{3} $$  which implies $x=y$, so the function $f$ is injective. Now replace $x$ by $x y$ in (2), and apply (1) twice, second time to $\left(y, f(x)^{2}\right)$ instead of $(x, y)$ :  $$ f\left(f(x y)^{2}\right)=(x y)^{3} f(x y)=y^{3} f\left(f(x)^{2} y\right)=f\left(f(x)^{2} f(y)^{2}\right) $$  Since $f$ is injective, we get  $$ \begin{aligned} f(x y)^{2} & =f(x)^{2} f(y)^{2} \\ f(x y) & =f(x) f(y) . \end{aligned} $$  Therefore, $f$ is multiplicative. This also implies $f(1)=1$ and $f\left(x^{n}\right)=f(x)^{n}$ for all integers $n$. Then the function equation (1) can be re-written as  $$ \begin{aligned} f(f(x))^{2} f(y) & =x^{3} f(x) f(y), \\ f(f(x)) & =\sqrt{x^{3} f(x)} . \end{aligned} $$  Let $g(x)=x f(x)$. Then, by (3), we have  $$ \begin{aligned} g(g(x)) & =g(x f(x))=x f(x) \cdot f(x f(x))=x f(x)^{2} f(f(x))= \\ & =x f(x)^{2} \sqrt{x^{3} f(x)}=(x f(x))^{5 / 2}=(g(x))^{5 / 2} \end{aligned} $$  and, by induction, for every positive integer $n$. Consider (4) for a fixed $x$. The left-hand side is always rational, so $(g(x))^{(5 / 2)^{n}}$ must be rational for every $n$. We show that this is possible only if $g(x)=1$. Suppose that $g(x) \neq 1$, and let the prime factorization of $g(x)$ be $g(x)=p_{1}^{\alpha_{1}} \ldots p_{k}^{\alpha_{k}}$ where $p_{1}, \ldots, p_{k}$ are distinct primes and $\alpha_{1}, \ldots, \alpha_{k}$ are nonzero integers. Then the unique prime factorization of (4) is  $$ \underbrace{g(g(\ldots g}_{n+1}(x) \ldots))=(g(x))^{(5 / 2)^{n}}=p_{1}^{(5 / 2)^{n} \alpha_{1}} \cdots p_{k}^{(5 / 2)^{n} \alpha_{k}} $$  where the exponents should be integers. But this is not true for large values of $n$, for example $\left(\frac{5}{2}\right)^{n} \alpha_{1}$ cannot be a integer number when $2^{n} \nmid \alpha_{1}$. Therefore, $g(x) \neq 1$ is impossible.  Hence, $g(x)=1$ and thus $f(x)=\frac{1}{x}$ for all $x$. The function $f(x)=\frac{1}{x}$ satisfies the equation (1):  $$ f\left(f(x)^{2} y\right)=\frac{1}{f(x)^{2} y}=\frac{1}{\left(\frac{1}{x}\right)^{2} y}=\frac{x^{3}}{x y}=x^{3} f(x y) $$  Comment. Among $\mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$functions, $f(x)=\frac{1}{x}$ is not the only solution. Another solution is $f_{1}(x)=x^{3 / 2}$. Using transfinite tools, infinitely many other solutions can be constructed.


Suppose that $f$ and $g$ are two functions defined on the set of positive integers and taking positive integer values. Suppose also that the equations $f(g(n))=f(n)+1$ and $g(f(n))=$ $g(n)+1$ hold for all positive integers. Prove that $f(n)=g(n)$ for all positive integer $n$. (Germany)

Solution: Throughout the solution, by $\mathbb{N}$ we denote the set of all positive integers. For any function $h: \mathbb{N} \rightarrow \mathbb{N}$ and for any positive integer $k$, define $h^{k}(x)=\underbrace{h(h(\ldots h}_{k}(x) \ldots)$ ) (in particular, $\left.h^{0}(x)=x\right)$.  Observe that $f\left(g^{k}(x)\right)=f\left(g^{k-1}(x)\right)+1=\cdots=f(x)+k$ for any positive integer $k$, and similarly $g\left(f^{k}(x)\right)=g(x)+k$. Now let $a$ and $b$ are the minimal values attained by $f$ and $g$, respectively; say $f\left(n_{f}\right)=a, g\left(n_{g}\right)=b$. Then we have $f\left(g^{k}\left(n_{f}\right)\right)=a+k, g\left(f^{k}\left(n_{g}\right)\right)=b+k$, so the function $f$ attains all values from the set $N_{f}=\{a, a+1, \ldots\}$, while $g$ attains all the values from the set $N_{g}=\{b, b+1, \ldots\}$.  Next, note that $f(x)=f(y)$ implies $g(x)=g(f(x))-1=g(f(y))-1=g(y)$; surely, the converse implication also holds. Now, we say that $x$ and $y$ are similar (and write $x \sim y$ ) if $f(x)=f(y)$ (equivalently, $g(x)=g(y)$ ). For every $x \in \mathbb{N}$, we define $[x]=\{y \in \mathbb{N}: x \sim y\}$; surely, $y_{1} \sim y_{2}$ for all $y_{1}, y_{2} \in[x]$, so $[x]=[y]$ whenever $y \in[x]$.  Now we investigate the structure of the sets $[x]$. Claim 1. Suppose that $f(x) \sim f(y)$; then $x \sim y$, that is, $f(x)=f(y)$. Consequently, each class $[x]$ contains at most one element from $N_{f}$, as well as at most one element from $N_{g}$. Proof. If $f(x) \sim f(y)$, then we have $g(x)=g(f(x))-1=g(f(y))-1=g(y)$, so $x \sim y$. The second statement follows now from the sets of values of $f$ and $g$.  Next, we clarify which classes do not contain large elements. Claim 2. For any $x \in \mathbb{N}$, we have $[x] \subseteq\{1,2, \ldots, b-1\}$ if and only if $f(x)=a$. Analogously, $[x] \subseteq\{1,2, \ldots, a-1\}$ if and only if $g(x)=b$. Proof. We will prove that $[x] \nsubseteq\{1,2, \ldots, b-1\} \Longleftrightarrow f(x)>a$; the proof of the second statement is similar.  Note that $f(x)>a$ implies that there exists some $y$ satisfying $f(y)=f(x)-1$, so $f(g(y))=$ $f(y)+1=f(x)$, and hence $x \sim g(y) \geq b$. Conversely, if $b \leq c \sim x$ then $c=g(y)$ for some $y \in \mathbb{N}$, which in turn follows $f(x)=f(g(y))=f(y)+1 \geq a+1$, and hence $f(x)>a$.  Claim 2 implies that there exists exactly one class contained in $\{1, \ldots, a-1\}$ (that is, the class $\left[n_{g}\right]$ ), as well as exactly one class contained in $\{1, \ldots, b-1\}$ (the class $\left[n_{f}\right]$ ). Assume for a moment that $a \leq b$; then $\left[n_{g}\right]$ is contained in $\{1, \ldots, b-1\}$ as well, hence it coincides with $\left[n_{g}\right]$. So, we get that  $$ f(x)=a \Longleftrightarrow g(x)=b \Longleftrightarrow x \sim n_{f} \sim n_{g} . $$  Claim 3. $a=b$. Proof. By Claim 2, we have $[a] \neq\left[n_{f}\right]$, so $[a]$ should contain some element $a^{\prime} \geq b$ by Claim 2 again. If $a \neq a^{\prime}$, then $[a]$ contains two elements $\geq a$ which is impossible by Claim 1. Therefore, $a=a^{\prime} \geq b$. Similarly, $b \geq a$.  Now we are ready to prove the problem statement. First, we establish the following Claim 4. For every integer $d \geq 0, f^{d+1}\left(n_{f}\right)=g^{d+1}\left(n_{f}\right)=a+d$. Proof. Induction on $d$. For $d=0$, the statement follows from (1) and Claim 3. Next, for $d>1$ from the induction hypothesis we have $f^{d+1}\left(n_{f}\right)=f\left(f^{d}\left(n_{f}\right)\right)=f\left(g^{d}\left(n_{f}\right)\right)=f\left(n_{f}\right)+d=a+d$. The equality $g^{d+1}\left(n_{f}\right)=a+d$ is analogous.  Finally, for each $x \in \mathbb{N}$, we have $f(x)=a+d$ for some $d \geq 0$, so $f(x)=f\left(g^{d}\left(n_{f}\right)\right)$ and hence $x \sim g^{d}\left(n_{f}\right)$. It follows that $g(x)=g\left(g^{d}\left(n_{f}\right)\right)=g^{d+1}\left(n_{f}\right)=a+d=f(x)$ by Claim 4 .


Solution: We start with the same observations, introducing the relation $\sim$ and proving Claim 1 from the previous solution.  Note that $f(a)>a$ since otherwise we have $f(a)=a$ and hence $g(a)=g(f(a))=g(a)+1$, which is false. Claim 2'. $a=b$. Proof. We can assume that $a \leq b$. Since $f(a) \geq a+1$, there exists some $x \in \mathbb{N}$ such that $f(a)=f(x)+1$, which is equivalent to $f(a)=f(g(x))$ and $a \sim g(x)$. Since $g(x) \geq b \geq a$, by Claim 1 we have $a=g(x) \geq b$, which together with $a \leq b$ proves the Claim.  Now, almost the same method allows to find the values $f(a)$ and $g(a)$. Claim 3'. $f(a)=g(a)=a+1$. Proof. Assume the contrary; then $f(a) \geq a+2$, hence there exist some $x, y \in \mathbb{N}$ such that $f(x)=f(a)-2$ and $f(y)=g(x)($ as $g(x) \geq a=b)$. Now we get $f(a)=f(x)+2=f\left(g^{2}(x)\right)$, so $a \sim g^{2}(x) \geq a$, and by Claim 1 we get $a=g^{2}(x)=g(f(y))=1+g(y) \geq 1+a$; this is impossible. The equality $g(a)=a+1$ is similar.  Now, we are prepared for the proof of the problem statement. First, we prove it for $n \geq a$. Claim 4'. For each integer $x \geq a$, we have $f(x)=g(x)=x+1$. Proof. Induction on $x$. The base case $x=a$ is provided by Claim $3^{\prime}$, while the induction step follows from $f(x+1)=f(g(x))=f(x)+1=(x+1)+1$ and the similar computation for $g(x+1)$.  Finally, for an arbitrary $n \in \mathbb{N}$ we have $g(n) \geq a$, so by Claim $4^{\prime}$ we have $f(n)+1=$ $f(g(n))=g(n)+1$, hence $f(n)=g(n)$. Comment. It is not hard now to describe all the functions $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfying the property $f(f(n))=$ $f(n)+1$. For each such function, there exists $n_{0} \in \mathbb{N}$ such that $f(n)=n+1$ for all $n \geq n_{0}$, while for each $n<n_{0}, f(n)$ is an arbitrary number greater than of equal to $n_{0}$ (these numbers may be different for different $n<n_{0}$ ).


Let $a_{1}, \ldots, a_{r}$ be positive real numbers. For $n>r$, we inductively define  $$ a_{n}=\max _{1 \leq k \leq n-1}\left(a_{k}+a_{n-k}\right) $$  Prove that there exist positive integers $\ell \leq r$ and $N$ such that $a_{n}=a_{n-\ell}+a_{\ell}$ for all $n \geq N$. (Iran)

Solution: First, from the problem conditions we have that each $a_{n}(n>r)$ can be expressed as $a_{n}=a_{j_{1}}+a_{j_{2}}$ with $j_{1}, j_{2}<n, j_{1}+j_{2}=n$. If, say, $j_{1}>r$ then we can proceed in the same way with $a_{j_{1}}$, and so on. Finally, we represent $a_{n}$ in a form  $$ \begin{gathered} a_{n}=a_{i_{1}}+\cdots+a_{i_{k}}, \\ 1 \leq i_{j} \leq r, \quad i_{1}+\cdots+i_{k}=n . \end{gathered} $$  Moreover, if $a_{i_{1}}$ and $a_{i_{2}}$ are the numbers in (2) obtained on the last step, then $i_{1}+i_{2}>r$. Hence we can adjust (3) as  $$ 1 \leq i_{j} \leq r, \quad i_{1}+\cdots+i_{k}=n, \quad i_{1}+i_{2}>r . $$  On the other hand, suppose that the indices $i_{1}, \ldots, i_{k}$ satisfy the conditions (4). Then, denoting $s_{j}=i_{1}+\cdots+i_{j}$, from (1) we have  $$ a_{n}=a_{s_{k}} \geq a_{s_{k-1}}+a_{i_{k}} \geq a_{s_{k-2}}+a_{i_{k-1}}+a_{i_{k}} \geq \cdots \geq a_{i_{1}}+\cdots+a_{i_{k}} $$  Summarizing these observations we get the following Claim. For every $n>r$, we have  $$ a_{n}=\max \left\{a_{i_{1}}+\cdots+a_{i_{k}}: \text { the collection }\left(i_{1}, \ldots, i_{k}\right) \text { satisfies }(4)\right\} $$  Now we denote  $$ s=\max _{1 \leq i \leq r} \frac{a_{i}}{i} $$  and fix some index $\ell \leq r$ such that $s=\frac{a_{\ell}}{\ell}$. Consider some $n \geq r^{2} \ell+2 r$ and choose an expansion of $a_{n}$ in the form (2), (4). Then we have $n=i_{1}+\cdots+i_{k} \leq r k$, so $k \geq n / r \geq r \ell+2$. Suppose that none of the numbers $i_{3}, \ldots, i_{k}$ equals $\ell$. Then by the pigeonhole principle there is an index $1 \leq j \leq r$ which appears among $i_{3}, \ldots, i_{k}$ at least $\ell$ times, and surely $j \neq \ell$. Let us delete these $\ell$ occurrences of $j$ from $\left(i_{1}, \ldots, i_{k}\right)$, and add $j$ occurrences of $\ell$ instead, obtaining a sequence $\left(i_{1}, i_{2}, i_{3}^{\prime}, \ldots, i_{k^{\prime}}^{\prime}\right)$ also satisfying (4). By Claim, we have  $$ a_{i_{1}}+\cdots+a_{i_{k}}=a_{n} \geq a_{i_{1}}+a_{i_{2}}+a_{i_{3}^{\prime}}+\cdots+a_{i_{k^{\prime}}^{\prime}} $$  or, after removing the coinciding terms, $\ell a_{j} \geq j a_{\ell}$, so $\frac{a_{\ell}}{\ell} \leq \frac{a_{j}}{j}$. By the definition of $\ell$, this means that $\ell a_{j}=j a_{\ell}$, hence  $$ a_{n}=a_{i_{1}}+a_{i_{2}}+a_{i_{3}^{\prime}}+\cdots+a_{i_{k^{\prime}}^{\prime}} $$  Thus, for every $n \geq r^{2} \ell+2 r$ we have found a representation of the form (2), (4) with $i_{j}=\ell$ for some $j \geq 3$. Rearranging the indices we may assume that $i_{k}=\ell$.  Finally, observe that in this representation, the indices $\left(i_{1}, \ldots, i_{k-1}\right)$ satisfy the conditions (4) with $n$ replaced by $n-\ell$. Thus, from the Claim we get  $$ a_{n-\ell}+a_{\ell} \geq\left(a_{i_{1}}+\cdots+a_{i_{k-1}}\right)+a_{\ell}=a_{n} $$  which by (1) implies  $$ a_{n}=a_{n-\ell}+a_{\ell} \quad \text { for each } n \geq r^{2} \ell+2 r $$  as desired.


Solution: As in the previous solution, we involve the expansion (2), (3), and we fix some index $1 \leq \ell \leq r$ such that  $$ \frac{a_{\ell}}{\ell}=s=\max _{1 \leq i \leq r} \frac{a_{i}}{i} $$  Now, we introduce the sequence $\left(b_{n}\right)$ as $b_{n}=a_{n}-s n$; then $b_{\ell}=0$. We prove by induction on $n$ that $b_{n} \leq 0$, and $\left(b_{n}\right)$ satisfies the same recurrence relation as $\left(a_{n}\right)$. The base cases $n \leq r$ follow from the definition of $s$. Now, for $n>r$ from the induction hypothesis we have  $$ b_{n}=\max _{1 \leq k \leq n-1}\left(a_{k}+a_{n-k}\right)-n s=\max _{1 \leq k \leq n-1}\left(b_{k}+b_{n-k}+n s\right)-n s=\max _{1 \leq k \leq n-1}\left(b_{k}+b_{n-k}\right) \leq 0 $$  as required. Now, if $b_{k}=0$ for all $1 \leq k \leq r$, then $b_{n}=0$ for all $n$, hence $a_{n}=s n$, and the statement is trivial. Otherwise, define  $$ M=\max _{1 \leq i \leq r}\left|b_{i}\right|, \quad \varepsilon=\min \left\{\left|b_{i}\right|: 1 \leq i \leq r, b_{i}<0\right\} $$  Then for $n>r$ we obtain  $$ b_{n}=\max _{1 \leq k \leq n-1}\left(b_{k}+b_{n-k}\right) \geq b_{\ell}+b_{n-\ell}=b_{n-\ell} $$  so  $$ 0 \geq b_{n} \geq b_{n-\ell} \geq b_{n-2 \ell} \geq \cdots \geq-M $$  Thus, in view of the expansion (2), (3) applied to the sequence $\left(b_{n}\right)$, we get that each $b_{n}$ is contained in a set  $$ T=\left\{b_{i_{1}}+b_{i_{2}}+\cdots+b_{i_{k}}: i_{1}, \ldots, i_{k} \leq r\right\} \cap[-M, 0] $$  We claim that this set is finite. Actually, for any $x \in T$, let $x=b_{i_{1}}+\cdots+b_{i_{k}}\left(i_{1}, \ldots, i_{k} \leq r\right)$. Then among $b_{i_{j}}$ 's there are at most $\frac{M}{\varepsilon}$ nonzero terms (otherwise $x<\frac{M}{\varepsilon} \cdot(-\varepsilon)<-M$ ). Thus $x$ can be expressed in the same way with $k \leq \frac{M}{\varepsilon}$, and there is only a finite number of such sums.  Finally, for every $t=1,2, \ldots, \ell$ we get that the sequence  $$ b_{r+t}, b_{r+t+\ell}, b_{r+t+2 \ell}, \ldots $$  is non-decreasing and attains the finite number of values; therefore it is constant from some index. Thus, the sequence $\left(b_{n}\right)$ is periodic with period $\ell$ from some index $N$, which means that  $$ b_{n}=b_{n-\ell}=b_{n-\ell}+b_{\ell} \quad \text { for all } n>N+\ell $$  and hence  $$ a_{n}=b_{n}+n s=\left(b_{n-\ell}+(n-\ell) s\right)+\left(b_{\ell}+\ell s\right)=a_{n-\ell}+a_{\ell} \quad \text { for all } n>N+\ell \text {, } $$  as desired.


Given six positive numbers $a, b, c, d, e, f$ such that $a<b<c<d<e<f$. Let $a+c+e=S$ and $b+d+f=T$. Prove that  $$ 2 S T>\sqrt{3(S+T)(S(b d+b f+d f)+T(a c+a e+c e))} $$  (South Korea)

Solution: We define also $\sigma=a c+c e+a e, \tau=b d+b f+d f$. The idea of the solution is to interpret (1) as a natural inequality on the roots of an appropriate polynomial.  Actually, consider the polynomial  $$ \begin{aligned} & P(x)=(b+d+f)(x-a)(x-c)(x-e)+(a+c+e)(x-b)(x-d)(x-f) \\ &=T\left(x^{3}-S x^{2}+\sigma x-a c e\right)+S\left(x^{3}-T x^{2}+\tau x-b d f\right) \end{aligned} $$  Surely, $P$ is cubic with leading coefficient $S+T>0$. Moreover, we have  $$ \begin{array}{ll} P(a)=S(a-b)(a-d)(a-f)<0, & P(c)=S(c-b)(c-d)(c-f)>0 \\ P(e)=S(e-b)(e-d)(e-f)<0, & P(f)=T(f-a)(f-c)(f-e)>0 \end{array} $$  Hence, each of the intervals $(a, c),(c, e),(e, f)$ contains at least one root of $P(x)$. Since there are at most three roots at all, we obtain that there is exactly one root in each interval (denote them by $\alpha \in(a, c), \beta \in(c, e), \gamma \in(e, f))$. Moreover, the polynomial $P$ can be factorized as  $$ P(x)=(T+S)(x-\alpha)(x-\beta)(x-\gamma) $$  Equating the coefficients in the two representations (2) and (3) of $P(x)$ provides  $$ \alpha+\beta+\gamma=\frac{2 T S}{T+S}, \quad \alpha \beta+\alpha \gamma+\beta \gamma=\frac{S \tau+T \sigma}{T+S} $$  Now, since the numbers $\alpha, \beta, \gamma$ are distinct, we have  $$ 0<(\alpha-\beta)^{2}+(\alpha-\gamma)^{2}+(\beta-\gamma)^{2}=2(\alpha+\beta+\gamma)^{2}-6(\alpha \beta+\alpha \gamma+\beta \gamma) $$  which implies  $$ \frac{4 S^{2} T^{2}}{(T+S)^{2}}=(\alpha+\beta+\gamma)^{2}>3(\alpha \beta+\alpha \gamma+\beta \gamma)=\frac{3(S \tau+T \sigma)}{T+S} $$  or  $$ 4 S^{2} T^{2}>3(T+S)(T \sigma+S \tau) $$  which is exactly what we need. Comment 1. In fact, one can locate the roots of $P(x)$ more narrowly: they should lie in the intervals $(a, b),(c, d),(e, f)$.  Surely, if we change all inequality signs in the problem statement to non-strict ones, the (non-strict) inequality will also hold by continuity. One can also find when the equality is achieved. This happens in that case when $P(x)$ is a perfect cube, which immediately implies that $b=c=d=e(=\alpha=\beta=\gamma)$, together with the additional condition that $P^{\prime \prime}(b)=0$. Algebraically,  $$ \begin{array}{rlr} 6(T+S) b-4 T S=0 & \Longleftrightarrow & 3 b(a+4 b+f)=2(a+2 b)(2 b+f) \\ & \Longleftrightarrow & f=\frac{b(4 b-a)}{2 a+b}=b\left(1+\frac{3(b-a)}{2 a+b}\right)>b \end{array} $$  This means that for every pair of numbers $a, b$ such that $0<a<b$, there exists $f>b$ such that the point $(a, b, b, b, b, f)$ is a point of equality.


Solution: Let  $$ U=\frac{1}{2}\left((e-a)^{2}+(c-a)^{2}+(e-c)^{2}\right)=S^{2}-3(a c+a e+c e) $$  and  $$ V=\frac{1}{2}\left((f-b)^{2}+(f-d)^{2}+(d-b)^{2}\right)=T^{2}-3(b d+b f+d f) $$  Then  $$ \begin{aligned} & \text { (L.H.S. })^{2}-(\text { R.H.S. })^{2}=(2 S T)^{2}-(S+T)(S \cdot 3(b d+b f+d f)+T \cdot 3(a c+a e+c e))= \\ & \quad=4 S^{2} T^{2}-(S+T)\left(S\left(T^{2}-V\right)+T\left(S^{2}-U\right)\right)=(S+T)(S V+T U)-S T(T-S)^{2} \end{aligned} $$  and the statement is equivalent with  $$ (S+T)(S V+T U)>S T(T-S)^{2} $$  By the Cauchy-Schwarz inequality,  $$ (S+T)(T U+S V) \geq(\sqrt{S \cdot T U}+\sqrt{T \cdot S V})^{2}=S T(\sqrt{U}+\sqrt{V})^{2} $$  Estimate the quantities $\sqrt{U}$ and $\sqrt{V}$ by the QM-AM inequality with the positive terms $(e-c)^{2}$ and $(d-b)^{2}$ being omitted:  $$ \begin{aligned} \sqrt{U}+\sqrt{V} & >\sqrt{\frac{(e-a)^{2}+(c-a)^{2}}{2}}+\sqrt{\frac{(f-b)^{2}+(f-d)^{2}}{2}} \\ & >\frac{(e-a)+(c-a)}{2}+\frac{(f-b)+(f-d)}{2}=\left(f-\frac{d}{2}-\frac{b}{2}\right)+\left(\frac{e}{2}+\frac{c}{2}-a\right) \\ & =(T-S)+\frac{3}{2}(e-d)+\frac{3}{2}(c-b)>T-S . \end{aligned} $$  The estimates (5) and (6) prove (4) and hence the statement.


Solution: We keep using the notations $\sigma$ and $\tau$ from   $$ (c-b)(c-d)+(e-f)(e-d)+(e-f)(c-b)<0 $$  since each summand is negative. This rewrites as  $$ \begin{gathered} (b d+b f+d f)-(a c+c e+a e)<(c+e)(b+d+f-a-c-e), \text { or } \\ \tau-\sigma<s(T-S) . \end{gathered} $$  Then we have  $$ \begin{aligned} S \tau+T \sigma & =S(\tau-\sigma)+(S+T) \sigma<S s(T-S)+(S+T)(c e+a s) \\ & \leq S s(T-S)+(S+T)\left(\frac{s^{2}}{4}+(S-s) s\right)=s\left(2 S T-\frac{3}{4}(S+T) s\right) \end{aligned} $$  Using this inequality together with the AM-GM inequality we get  $$ \begin{aligned} \sqrt{\frac{3}{4}(S+T)(S \tau+T \sigma)} & <\sqrt{\frac{3}{4}(S+T) s\left(2 S T-\frac{3}{4}(S+T) s\right)} \\ & \leq \frac{\frac{3}{4}(S+T) s+2 S T-\frac{3}{4}(S+T) s}{2}=S T . \end{aligned} $$  Hence,  $$ 2 S T>\sqrt{3(S+T)(S(b d+b f+d f)+T(a c+a e+c e))} $$  Comment 2. The expression (7) can be found by considering the sum of the roots of the quadratic polynomial $q(x)=(x-b)(x-d)(x-f)-(x-a)(x-c)(x-e)$.


Solution: We introduce the expressions $\sigma$ and $\tau$ as in the previous solutions. The idea of the solution is to change the values of variables $a, \ldots, f$ keeping the left-hand side unchanged and increasing the right-hand side; it will lead to a simpler inequality which can be proved in a direct way.  Namely, we change the variables (i) keeping the (non-strict) inequalities $a \leq b \leq c \leq d \leq$ $e \leq f$; (ii) keeping the values of sums $S$ and $T$ unchanged; and finally (iii) increasing the values of $\sigma$ and $\tau$. Then the left-hand side of (1) remains unchanged, while the right-hand side increases. Hence, the inequality (1) (and even a non-strict version of (1)) for the changed values would imply the same (strict) inequality for the original values.  First, we find the sufficient conditions for (ii) and (iii) to be satisfied. Lemma. Let $x, y, z>0$; denote $U(x, y, z)=x+y+z, v(x, y, z)=x y+x z+y z$. Suppose that $x^{\prime}+y^{\prime}=x+y$ but $|x-y| \geq\left|x^{\prime}-y^{\prime}\right| ;$ then we have $U\left(x^{\prime}, y^{\prime}, z\right)=U(x, y, z)$ and $v\left(x^{\prime}, y^{\prime}, z\right) \geq$ $v(x, y, z)$ with equality achieved only when $|x-y|=\left|x^{\prime}-y^{\prime}\right|$. Proof. The first equality is obvious. For the second, we have  $$ \begin{aligned} v\left(x^{\prime}, y^{\prime}, z\right)=z\left(x^{\prime}+y^{\prime}\right)+x^{\prime} y^{\prime} & =z\left(x^{\prime}+y^{\prime}\right)+\frac{\left(x^{\prime}+y^{\prime}\right)^{2}-\left(x^{\prime}-y^{\prime}\right)^{2}}{4} \\ & \geq z(x+y)+\frac{(x+y)^{2}-(x-y)^{2}}{4}=v(x, y, z) \end{aligned} $$  with the equality achieved only for $\left(x^{\prime}-y^{\prime}\right)^{2}=(x-y)^{2} \Longleftrightarrow\left|x^{\prime}-y^{\prime}\right|=|x-y|$, as desired.  Now, we apply Lemma several times making the following changes. For each change, we denote the new values by the same letters to avoid cumbersome notations.  1. Let $k=\frac{d-c}{2}$. Replace $(b, c, d, e)$ by $(b+k, c+k, d-k, e-k)$. After the change we have $a<b<c=d<e<f$, the values of $S, T$ remain unchanged, but $\sigma, \tau$ strictly increase by Lemma. 2. Let $\ell=\frac{e-d}{2}$. Replace $(c, d, e, f)$ by $(c+\ell, d+\ell, e-\ell, f-\ell)$. After the change we have $a<b<c=d=e<f$, the values of $S, T$ remain unchanged, but $\sigma, \tau$ strictly increase by the Lemma. 3. Finally, let $m=\frac{c-b}{3}$. Replace $(a, b, c, d, e, f)$ by $(a+2 m, b+2 m, c-m, d-m, e-m, f-m)$. After the change, we have $a<b=c=d=e<f$ and $S, T$ are unchanged. To check (iii), we observe that our change can be considered as a composition of two changes: $(a, b, c, d) \rightarrow$ $(a+m, b+m, c-m, d-m)$ and $(a, b, e, f) \rightarrow(a+m, b+m, e-m, f-m)$. It is easy to see that each of these two consecutive changes satisfy the conditions of the Lemma, hence the values of $\sigma$ and $\tau$ increase.  Finally, we come to the situation when $a<b=c=d=e<f$, and we need to prove the inequality  $$ \begin{aligned} 2(a+2 b)(2 b+f) & \geq \sqrt{3(a+4 b+f)\left((a+2 b)\left(b^{2}+2 b f\right)+(2 b+f)\left(2 a b+b^{2}\right)\right)} \\ & =\sqrt{3 b(a+4 b+f) \cdot((a+2 b)(b+2 f)+(2 b+f)(2 a+b))} \end{aligned} $$  Now, observe that  $$ 2 \cdot 2(a+2 b)(2 b+f)=3 b(a+4 b+f)+((a+2 b)(b+2 f)+(2 a+b)(2 b+f)) $$  Hence (4) rewrites as  $$ \begin{aligned} 3 b(a+4 b+f) & +((a+2 b)(b+2 f)+(2 a+b)(2 b+f)) \\ & \geq 2 \sqrt{3 b(a+4 b+f) \cdot((a+2 b)(b+2 f)+(2 b+f)(2 a+b))} \end{aligned} $$  which is simply the AM-GM inequality. Comment 3. Here, we also can find all the cases of equality. Actually, it is easy to see that if some two numbers among $b, c, d, e$ are distinct then one can use Lemma to increase the right-hand side of (1). Further, if $b=c=d=e$, then we need equality in (4); this means that we apply AM-GM to equal numbers, that is,  $$ 3 b(a+4 b+f)=(a+2 b)(b+2 f)+(2 a+b)(2 b+f) $$  which leads to the same equality as in Comment 1.


In a concert, 20 singers will perform. For each singer, there is a (possibly empty) set of other singers such that he wishes to perform later than all the singers from that set. Can it happen that there are exactly 2010 orders of the singers such that all their wishes are satisfied? (Austria) Answer. Yes, such an example exists.

Solution: We say that an order of singers is good if it satisfied all their wishes. Next, we say that a number $N$ is realizable by $k$ singers (or $k$-realizable) if for some set of wishes of these singers there are exactly $N$ good orders. Thus, we have to prove that a number 2010 is 20-realizable.  We start with the following simple Lemma. Suppose that numbers $n_{1}, n_{2}$ are realizable by respectively $k_{1}$ and $k_{2}$ singers. Then the number $n_{1} n_{2}$ is $\left(k_{1}+k_{2}\right)$-realizable. Proof. Let the singers $A_{1}, \ldots, A_{k_{1}}$ (with some wishes among them) realize $n_{1}$, and the singers $B_{1}$, $\ldots, B_{k_{2}}$ (with some wishes among them) realize $n_{2}$. Add to each singer $B_{i}$ the wish to perform later than all the singers $A_{j}$. Then, each good order of the obtained set of singers has the form $\left(A_{i_{1}}, \ldots, A_{i_{k_{1}}}, B_{j_{1}}, \ldots, B_{j_{k_{2}}}\right)$, where $\left(A_{i_{1}}, \ldots, A_{i_{k_{1}}}\right)$ is a good order for $A_{i}$ 's and $\left(B_{j_{1}}, \ldots, B_{j_{k_{2}}}\right)$ is a good order for $B_{j}$ 's. Conversely, each order of this form is obviously good. Hence, the number of good orders is $n_{1} n_{2}$.  In view of Lemma, we show how to construct sets of singers containing 4, 3 and 13 singers and realizing the numbers 5, 6 and 67 , respectively. Thus the number $2010=6 \cdot 5 \cdot 67$ will be realizable by $4+3+13=20$ singers. These companies of singers are shown in Figs. 1-3; the wishes are denoted by arrows, and the number of good orders for each Figure stands below in the brackets. ![](https://cdn.mathpix.com/cropped/2024_11_18_ba86565be3364967ae6fg-24.jpg?height=190&width=244&top_left_y=2098&top_left_x=438) (5)  Fig. 1 ![](https://cdn.mathpix.com/cropped/2024_11_18_ba86565be3364967ae6fg-24.jpg?height=590&width=724&top_left_y=1898&top_left_x=846) (67)  Fig. 3 For Fig. 1, there are exactly 5 good orders $(a, b, c, d),(a, b, d, c),(b, a, c, d),(b, a, d, c)$, $(b, d, a, c)$. For Fig. 2, each of 6 orders is good since there are no wishes.  Finally, for Fig. 3, the order of $a_{1}, \ldots, a_{11}$ is fixed; in this line, singer $x$ can stand before each of $a_{i}(i \leq 9)$, and singer $y$ can stand after each of $a_{j}(j \geq 5)$, thus resulting in $9 \cdot 7=63$ cases. Further, the positions of $x$ and $y$ in this line determine the whole order uniquely unless both of them come between the same pair $\left(a_{i}, a_{i+1}\right)$ (thus $5 \leq i \leq 8$ ); in the latter cases, there are two orders instead of 1 due to the order of $x$ and $y$. Hence, the total number of good orders is $63+4=67$, as desired.  Comment. The number 20 in the problem statement is not sharp and is put there to respect the original formulation. So, if necessary, the difficulty level of this problem may be adjusted by replacing 20 by a smaller number. Here we present some improvements of the example leading to a smaller number of singers.  Surely, each example with $<20$ singers can be filled with some "super-stars" who should perform at the very end in a fixed order. Hence each of these improvements provides a different solution for the problem. Moreover, the large variety of ideas standing behind these examples allows to suggest that there are many other examples.  1. Instead of building the examples realizing 5 and 6 , it is more economic to make an example realizing 30; it may seem even simpler. Two possible examples consisting of 5 and 6 singers are shown in Fig. 4; hence the number 20 can be decreased to 19 or 18 .  For Fig. 4a, the order of $a_{1}, \ldots, a_{4}$ is fixed, there are 5 ways to add $x$ into this order, and there are 6 ways to add $y$ into the resulting order of $a_{1}, \ldots, a_{4}, x$. Hence there are $5 \cdot 6=30$ good orders.  On Fig. 4b, for 5 singers $a, b_{1}, b_{2}, c_{1}, c_{2}$ there are $5!=120$ orders at all. Obviously, exactly one half of them satisfies the wish $b_{1} \leftarrow b_{2}$, and exactly one half of these orders satisfies another wish $c_{1} \leftarrow c_{2}$; hence, there are exactly $5!/ 4=30$ good orders. ![](https://cdn.mathpix.com/cropped/2024_11_18_ba86565be3364967ae6fg-25.jpg?height=560&width=1583&top_left_y=1599&top_left_x=271) 2. One can merge the examples for 30 and 67 shown in Figs. 4 b and 3 in a smarter way, obtaining a set of 13 singers representing 2010. This example is shown in Fig. 5; an arrow from/to group $\left\{b_{1}, \ldots, b_{5}\right\}$ means that there exists such arrow from each member of this group.  Here, as in Fig. 4b, one can see that there are exactly 30 orders of $b_{1}, \ldots, b_{5}, a_{6}, \ldots, a_{11}$ satisfying all their wishes among themselves. Moreover, one can prove in the same way as for Fig. 3 that each of these orders can be complemented by $x$ and $y$ in exactly 67 ways, hence obtaining $30 \cdot 67=2010$ good orders at all.  Analogously, one can merge the examples in Figs. 1-3 to represent 2010 by 13 singers as is shown in Fig. 6. ![](https://cdn.mathpix.com/cropped/2024_11_18_ba86565be3364967ae6fg-26.jpg?height=521&width=1054&top_left_y=268&top_left_x=481) 3. Finally, we will present two other improvements; the proofs are left to the reader. The graph in Fig. 7 shows how 10 singers can represent 67 . Moreover, even a company of 10 singers representing 2010 can be found; this company is shown in Fig. 8.


On some planet, there are $2^{N}$ countries $(N \geq 4)$. Each country has a flag $N$ units wide and one unit high composed of $N$ fields of size $1 \times 1$, each field being either yellow or blue. No two countries have the same flag.  We say that a set of $N$ flags is diverse if these flags can be arranged into an $N \times N$ square so that all $N$ fields on its main diagonal will have the same color. Determine the smallest positive integer $M$ such that among any $M$ distinct flags, there exist $N$ flags forming a diverse set. (Croatia) Answer. $M=2^{N-2}+1$.

Solution: When speaking about the diagonal of a square, we will always mean the main diagonal.  Let $M_{N}$ be the smallest positive integer satisfying the problem condition. First, we show that $M_{N}>2^{N-2}$. Consider the collection of all $2^{N-2}$ flags having yellow first squares and blue second ones. Obviously, both colors appear on the diagonal of each $N \times N$ square formed by these flags.  We are left to show that $M_{N} \leq 2^{N-2}+1$, thus obtaining the desired answer. We start with establishing this statement for $N=4$.  Suppose that we have 5 flags of length 4 . We decompose each flag into two parts of 2 squares each; thereby, we denote each flag as $L R$, where the $2 \times 1$ flags $L, R \in \mathcal{S}=\{\mathrm{BB}, \mathrm{BY}, \mathrm{YB}, \mathrm{YY}\}$ are its left and right parts, respectively. First, we make two easy observations on the flags $2 \times 1$ which can be checked manually. (i) For each $A \in \mathcal{S}$, there exists only one $2 \times 1$ flag $C \in \mathcal{S}$ (possibly $C=A$ ) such that $A$ and $C$ cannot form a $2 \times 2$ square with monochrome diagonal (for part BB, that is YY, and for BY that is YB). (ii) Let $A_{1}, A_{2}, A_{3} \in \mathcal{S}$ be three distinct elements; then two of them can form a $2 \times 2$ square with yellow diagonal, and two of them can form a $2 \times 2$ square with blue diagonal (for all parts but BB , a pair $(\mathrm{BY}, \mathrm{YB})$ fits for both statements, while for all parts but BY, these pairs are $(\mathrm{YB}, \mathrm{YY})$ and (BB, YB)).  Now, let $\ell$ and $r$ be the numbers of distinct left and right parts of our 5 flags, respectively. The total number of flags is $5 \leq r \ell$, hence one of the factors (say, $r$ ) should be at least 3 . On the other hand, $\ell, r \leq 4$, so there are two flags with coinciding right part; let them be $L_{1} R_{1}$ and $L_{2} R_{1}\left(L_{1} \neq L_{2}\right)$.  Next, since $r \geq 3$, there exist some flags $L_{3} R_{3}$ and $L_{4} R_{4}$ such that $R_{1}, R_{3}, R_{4}$ are distinct. Let $L^{\prime} R^{\prime}$ be the remaining flag. By (i), one of the pairs $\left(L^{\prime}, L_{1}\right)$ and $\left(L^{\prime}, L_{2}\right)$ can form a $2 \times 2$ square with monochrome diagonal; we can assume that $L^{\prime}, L_{2}$ form a square with a blue diagonal. Finally, the right parts of two of the flags $L_{1} R_{1}, L_{3} R_{3}, L_{4} R_{4}$ can also form a $2 \times 2$ square with a blue diagonal by (ii). Putting these $2 \times 2$ squares on the diagonal of a $4 \times 4$ square, we find a desired arrangement of four flags.  We are ready to prove the problem statement by induction on $N$; actually, above we have proved the base case $N=4$. For the induction step, assume that $N>4$, consider any $2^{N-2}+1$ flags of length $N$, and arrange them into a large flag of size $\left(2^{N-2}+1\right) \times N$. This flag contains a non-monochrome column since the flags are distinct; we may assume that this column is the first one. By the pigeonhole principle, this column contains at least $\left\lceil\frac{2^{N-2}+1}{2}\right\rceil=2^{N-3}+1$ squares of one color (say, blue). We call the flags with a blue first square good.  Consider all the good flags and remove the first square from each of them. We obtain at least $2^{N-3}+1 \geq M_{N-1}$ flags of length $N-1$; by the induction hypothesis, $N-1$ of them can form a square $Q$ with the monochrome diagonal. Now, returning the removed squares, we obtain a rectangle $(N-1) \times N$, and our aim is to supplement it on the top by one more flag.  If $Q$ has a yellow diagonal, then we can take each flag with a yellow first square (it exists by a choice of the first column; moreover, it is not used in $Q$ ). Conversely, if the diagonal of $Q$ is blue then we can take any of the $\geq 2^{N-3}+1-(N-1)>0$ remaining good flags. So, in both cases we get a desired $N \times N$ square.


Solution: We present a different proof of the estimate $M_{N} \leq 2^{N-2}+1$. We do not use the induction, involving Hall's lemma on matchings instead.  Consider arbitrary $2^{N-2}+1$ distinct flags and arrange them into a large $\left(2^{N-2}+1\right) \times N$ flag. Construct two bipartite graphs $G_{\mathrm{y}}=\left(V \cup V^{\prime}, E_{\mathrm{y}}\right)$ and $G_{\mathrm{b}}=\left(V \cup V^{\prime}, E_{\mathrm{b}}\right)$ with the common set of vertices as follows. Let $V$ and $V^{\prime}$ be the set of columns and the set of flags under consideration, respectively. Next, let the edge $(c, f)$ appear in $E_{\mathrm{y}}$ if the intersection of column $c$ and flag $f$ is yellow, and $(c, f) \in E_{\mathrm{b}}$ otherwise. Then we have to prove exactly that one of the graphs $G_{\mathrm{y}}$ and $G_{\mathrm{b}}$ contains a matching with all the vertices of $V$ involved.  Assume that these matchings do not exist. By Hall's lemma, it means that there exist two sets of columns $S_{\mathrm{y}}, S_{\mathrm{b}} \subset V$ such that $\left|E_{\mathrm{y}}\left(S_{\mathrm{y}}\right)\right| \leq\left|S_{\mathrm{y}}\right|-1$ and $\left|E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)\right| \leq\left|S_{\mathrm{b}}\right|-1$ (in the left-hand sides, $E_{\mathrm{y}}\left(S_{\mathrm{y}}\right)$ and $E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)$ denote respectively the sets of all vertices connected to $S_{\mathrm{y}}$ and $S_{\mathrm{b}}$ in the corresponding graphs). Our aim is to prove that this is impossible. Note that $S_{\mathrm{y}}, S_{\mathrm{b}} \neq V$ since $N \leq 2^{N-2}+1$.  First, suppose that $S_{\mathrm{y}} \cap S_{\mathrm{b}} \neq \varnothing$, so there exists some $c \in S_{\mathrm{y}} \cap S_{\mathrm{b}}$. Note that each flag is connected to $c$ either in $G_{\mathrm{y}}$ or in $G_{\mathrm{b}}$, hence $E_{\mathrm{y}}\left(S_{\mathrm{y}}\right) \cup E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)=V^{\prime}$. Hence we have $2^{N-2}+1=\left|V^{\prime}\right| \leq\left|E_{\mathrm{y}}\left(S_{\mathrm{y}}\right)\right|+\left|E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)\right| \leq\left|S_{\mathrm{y}}\right|+\left|S_{\mathrm{b}}\right|-2 \leq 2 N-4$; this is impossible for $N \geq 4$.  So, we have $S_{\mathrm{y}} \cap S_{\mathrm{b}}=\varnothing$. Let $y=\left|S_{\mathrm{y}}\right|, b=\left|S_{\mathrm{b}}\right|$. From the construction of our graph, we have that all the flags in the set $V^{\prime \prime}=V^{\prime} \backslash\left(E_{\mathrm{y}}\left(S_{\mathrm{y}}\right) \cup E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)\right)$ have blue squares in the columns of $S_{\mathrm{y}}$ and yellow squares in the columns of $S_{\mathrm{b}}$. Hence the only undetermined positions in these flags are the remaining $N-y-b$ ones, so $2^{N-y-b} \geq\left|V^{\prime \prime}\right| \geq\left|V^{\prime}\right|-\left|E_{\mathrm{y}}\left(S_{\mathrm{y}}\right)\right|-\left|E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)\right| \geq$ $2^{N-2}+1-(y-1)-(b-1)$, or, denoting $c=y+b, 2^{N-c}+c>2^{N-2}+2$. This is impossible since $N \geq c \geq 2$.


2500 chess kings have to be placed on a $100 \times 100$ chessboard so that (i) no king can capture any other one (i.e. no two kings are placed in two squares sharing a common vertex); (ii) each row and each column contains exactly 25 kings.  Find the number of such arrangements. (Two arrangements differing by rotation or symmetry are supposed to be different.) (Russia) Answer. There are two such arrangements.

Solution: Suppose that we have an arrangement satisfying the problem conditions. Divide the board into $2 \times 2$ pieces; we call these pieces blocks. Each block can contain not more than one king (otherwise these two kings would attack each other); hence, by the pigeonhole principle each block must contain exactly one king.  Now assign to each block a letter T or B if a king is placed in its top or bottom half, respectively. Similarly, assign to each block a letter L or R if a king stands in its left or right half. So we define $T$-blocks, $B$-blocks, $L$-blocks, and $R$-blocks. We also combine the letters; we call a block a TL-block if it is simultaneously T-block and L-block. Similarly we define TR-blocks, $B L$-blocks, and BR-blocks. The arrangement of blocks determines uniquely the arrangement of kings; so in the rest of the solution we consider the $50 \times 50$ system of blocks (see Fig. 1). We identify the blocks by their coordinate pairs; the pair $(i, j)$, where $1 \leq i, j \leq 50$, refers to the $j$ th block in the $i$ th row (or the $i$ th block in the $j$ th column). The upper-left block is $(1,1)$.  The system of blocks has the following properties.. ( $\left.\mathrm{i}^{\prime}\right)$ If $(i, j)$ is a B-block then $(i+1, j)$ is a B-block: otherwise the kings in these two blocks can take each other. Similarly: if $(i, j)$ is a T-block then $(i-1, j)$ is a T-block; if $(i, j)$ is an L-block then $(i, j-1)$ is an L-block; if $(i, j)$ is an R-block then $(i, j+1)$ is an R-block. (ii') Each column contains exactly 25 L-blocks and 25 R-blocks, and each row contains exactly 25 T -blocks and 25 B-blocks. In particular, the total number of L-blocks (or R-blocks, or T-blocks, or B-blocks) is equal to $25 \cdot 50=1250$.  Consider any B-block of the form $(1, j)$. By ( $\mathrm{i}^{\prime}$ ), all blocks in the $j$ th column are B-blocks; so we call such a column $B$-column. By (ii'), we have 25 B-blocks in the first row, so we obtain 25 B-columns. These 25 B-columns contain 1250 B-blocks, hence all blocks in the remaining columns are T-blocks, and we obtain 25 T-columns. Similarly, there are exactly $25 L$-rows and exactly $25 R$-rows.  Now consider an arbitrary pair of a T-column and a neighboring B-column (columns with numbers $j$ and $j+1$ ). ![](https://cdn.mathpix.com/cropped/2024_11_18_ba86565be3364967ae6fg-29.jpg?height=343&width=778&top_left_y=2127&top_left_x=436)  Fig. 1 ![](https://cdn.mathpix.com/cropped/2024_11_18_ba86565be3364967ae6fg-29.jpg?height=320&width=361&top_left_y=2150&top_left_x=1330)  Fig. 2  Case 1. Suppose that the $j$ th column is a T-column, and the $(j+1)$ th column is a Bcolumn. Consider some index $i$ such that the $i$ th row is an L-row; then $(i, j+1)$ is a BL-block. Therefore, $(i+1, j)$ cannot be a TR-block (see Fig. 2), hence $(i+1, j)$ is a TL-block, thus the $(i+1)$ th row is an L-row. Now, choosing the $i$ th row to be the topmost L-row, we successively obtain that all rows from the $i$ th to the 50 th are L-rows. Since we have exactly 25 L-rows, it follows that the rows from the 1st to the 25 th are R-rows, and the rows from the 26 th to the 50th are L-rows.  Now consider the neighboring R-row and L-row (that are the rows with numbers 25 and 26). Replacing in the previous reasoning rows by columns and vice versa, the columns from the 1 st to the 25 th are T-columns, and the columns from the 26 th to the 50 th are B-columns. So we have a unique arrangement of blocks that leads to the arrangement of kings satisfying the condition of the problem (see Fig. 3). ![](https://cdn.mathpix.com/cropped/2024_11_18_ba86565be3364967ae6fg-30.jpg?height=521&width=1020&top_left_y=796&top_left_x=204)  Fig. 3 ![](https://cdn.mathpix.com/cropped/2024_11_18_ba86565be3364967ae6fg-30.jpg?height=524&width=509&top_left_y=792&top_left_x=1296)  Fig. 4  Case 2. Suppose that the $j$ th column is a B-column, and the $(j+1)$ th column is a T-column. Repeating the arguments from Case 1, we obtain that the rows from the 1st to the 25th are L-rows (and all other rows are R-rows), the columns from the 1st to the 25 th are B-columns (and all other columns are T-columns), so we find exactly one more arrangement of kings (see Fig. 4).


Six stacks $S_{1}, \ldots, S_{6}$ of coins are standing in a row. In the beginning every stack contains a single coin. There are two types of allowed moves: Move 1: If stack $S_{k}$ with $1 \leq k \leq 5$ contains at least one coin, you may remove one coin from $S_{k}$ and add two coins to $S_{k+1}$. Move 2: If stack $S_{k}$ with $1 \leq k \leq 4$ contains at least one coin, then you may remove one coin from $S_{k}$ and exchange stacks $S_{k+1}$ and $S_{k+2}$. Decide whether it is possible to achieve by a sequence of such moves that the first five stacks are empty, whereas the sixth stack $S_{6}$ contains exactly $2010^{2010^{2010}}$ coins.  Same as Problem C4, but the constant $2010^{2010^{2010}}$ is replaced by $2010^{2010}$. (Netherlands) Answer. Yes (in both variants of the problem). There exists such a sequence of moves.

Solution: Denote by $\left(a_{1}, a_{2}, \ldots, a_{n}\right) \rightarrow\left(a_{1}^{\prime}, a_{2}^{\prime}, \ldots, a_{n}^{\prime}\right)$ the following: if some consecutive stacks contain $a_{1}, \ldots, a_{n}$ coins, then it is possible to perform several allowed moves such that the stacks contain $a_{1}^{\prime}, \ldots, a_{n}^{\prime}$ coins respectively, whereas the contents of the other stacks remain unchanged.  Let $A=2010^{2010}$ or $A=2010^{2010^{2010}}$, respectively. Our goal is to show that  $$ (1,1,1,1,1,1) \rightarrow(0,0,0,0,0, A) $$  First we prove two auxiliary observations. Lemma 1. $(a, 0,0) \rightarrow\left(0,2^{a}, 0\right)$ for every $a \geq 1$. Proof. We prove by induction that $(a, 0,0) \rightarrow\left(a-k, 2^{k}, 0\right)$ for every $1 \leq k \leq a$. For $k=1$, apply Move 1 to the first stack:  $$ (a, 0,0) \rightarrow(a-1,2,0)=\left(a-1,2^{1}, 0\right) $$  Now assume that $k<a$ and the statement holds for some $k<a$. Starting from $\left(a-k, 2^{k}, 0\right)$, apply Move 1 to the middle stack $2^{k}$ times, until it becomes empty. Then apply Move 2 to the first stack:  $$ \left(a-k, 2^{k}, 0\right) \rightarrow\left(a-k, 2^{k}-1,2\right) \rightarrow \cdots \rightarrow\left(a-k, 0,2^{k+1}\right) \rightarrow\left(a-k-1,2^{k+1}, 0\right) $$  Hence,  $$ (a, 0,0) \rightarrow\left(a-k, 2^{k}, 0\right) \rightarrow\left(a-k-1,2^{k+1}, 0\right) $$  Lemma 2. For every positive integer $n$, let $P_{n}=\underbrace{2^{2 \cdot y^{2}}}_{n}$ (e.g. $\quad P_{3}=2^{2^{2}}=16$ ). Then $(a, 0,0,0) \rightarrow\left(0, P_{a}, 0,0\right)$ for every $a \geq 1$. Proof. Similarly to Lemma 1 , we prove that $(a, 0,0,0) \rightarrow\left(a-k, P_{k}, 0,0\right)$ for every $1 \leq k \leq a$. For $k=1$, apply Move 1 to the first stack:  $$ (a, 0,0,0) \rightarrow(a-1,2,0,0)=\left(a-1, P_{1}, 0,0\right) $$  Now assume that the lemma holds for some $k<a$. Starting from ( $a-k, P_{k}, 0,0$ ), apply Lemma 1, then apply Move 1 to the first stack:  $$ \left(a-k, P_{k}, 0,0\right) \rightarrow\left(a-k, 0,2^{P_{k}}, 0\right)=\left(a-k, 0, P_{k+1}, 0\right) \rightarrow\left(a-k-1, P_{k+1}, 0,0\right) $$  Therefore,  $$ (a, 0,0,0) \rightarrow\left(a-k, P_{k}, 0,0\right) \rightarrow\left(a-k-1, P_{k+1}, 0,0\right) $$  Now we prove the statement of the problem. First apply Move 1 to stack 5 , then apply Move 2 to stacks $S_{4}, S_{3}, S_{2}$ and $S_{1}$ in this order. Then apply Lemma 2 twice:  $$ \begin{gathered} (1,1,1,1,1,1) \rightarrow(1,1,1,1,0,3) \rightarrow(1,1,1,0,3,0) \rightarrow(1,1,0,3,0,0) \rightarrow(1,0,3,0,0,0) \rightarrow \\ \rightarrow(0,3,0,0,0,0) \rightarrow\left(0,0, P_{3}, 0,0,0\right)=(0,0,16,0,0,0) \rightarrow\left(0,0,0, P_{16}, 0,0\right) \end{gathered} $$  We already have more than $A$ coins in stack $S_{4}$, since  $$ A \leq 2010^{2010^{2010}}<\left(2^{11}\right)^{2010^{2010}}=2^{11 \cdot 2010^{2010}}<2^{2010^{2011}}<2^{\left(2^{11}\right)^{2011}}=2^{2^{11 \cdot 2011}}<2^{2^{2^{15}}}<P_{16} $$  To decrease the number of coins in stack $S_{4}$, apply Move 2 to this stack repeatedly until its size decreases to $A / 4$. (In every step, we remove a coin from $S_{4}$ and exchange the empty stacks $S_{5}$ and $S_{6}$.)  $$ \begin{aligned} \left(0,0,0, P_{16}, 0,0\right) \rightarrow & \left(0,0,0, P_{16}-1,0,0\right) \rightarrow\left(0,0,0, P_{16}-2,0,0\right) \rightarrow \\ & \rightarrow \cdots \rightarrow(0,0,0, A / 4,0,0) . \end{aligned} $$  Finally, apply Move 1 repeatedly to empty stacks $S_{4}$ and $S_{5}$ :  $$ (0,0,0, A / 4,0,0) \rightarrow \cdots \rightarrow(0,0,0,0, A / 2,0) \rightarrow \cdots \rightarrow(0,0,0,0,0, A) $$  Comment 1. Starting with only 4 stack, it is not hard to check manually that we can achieve at most 28 coins in the last position. However, around 5 and 6 stacks the maximal number of coins explodes. With 5 stacks it is possible to achieve more than $2^{2^{14}}$ coins. With 6 stacks the maximum is greater than $P_{P_{2^{14}}}$.  It is not hard to show that the numbers $2010^{2010}$ and $2010^{2010^{2010}}$ in the problem can be replaced by any nonnegative integer up to $P_{P_{214}}$. Comment 2. The simpler variant $\mathrm{C}^{\prime}$ of the problem can be solved without Lemma 2:  $$ \begin{aligned} (1,1,1,1,1,1) & \rightarrow(0,3,1,1,1,1) \rightarrow(0,1,5,1,1,1) \rightarrow(0,1,1,9,1,1) \rightarrow \\ & \rightarrow(0,1,1,1,17,1) \rightarrow(0,1,1,1,0,35) \rightarrow(0,1,1,0,35,0) \rightarrow(0,1,0,35,0,0) \rightarrow \\ & \rightarrow(0,0,35,0,0,0) \rightarrow\left(0,0,1,2^{34}, 0,0\right) \rightarrow\left(0,0,1,0,2^{2^{34}}, 0\right) \rightarrow\left(0,0,0,2^{2^{34}}, 0,0\right) \\ & \rightarrow\left(0,0,0,2^{2^{34}}-1,0,0\right) \rightarrow \ldots \rightarrow(0,0,0, A / 4,0,0) \rightarrow(0,0,0,0, A / 2,0) \rightarrow(0,0,0,0,0, A) . \end{aligned} $$  For this reason, the PSC suggests to consider the problem C4 as well. Problem C4 requires more invention and technical care. On the other hand, the problem statement in $\mathrm{C} 4^{\prime}$ hides the fact that the resulting amount of coins can be such incredibly huge and leaves this discovery to the students.


$n \geq 4$ players participated in a tennis tournament. Any two players have played exactly one game, and there was no tie game. We call a company of four players bad if one player was defeated by the other three players, and each of these three players won a game and lost another game among themselves. Suppose that there is no bad company in this tournament. Let $w_{i}$ and $\ell_{i}$ be respectively the number of wins and losses of the $i$ th player. Prove that  $$ \sum_{i=1}^{n}\left(w_{i}-\ell_{i}\right)^{3} \geq 0 $$  (South Korea)

Solution: For any tournament $T$ satisfying the problem condition, denote by $S(T)$ sum under consideration, namely  $$ S(T)=\sum_{i=1}^{n}\left(w_{i}-\ell_{i}\right)^{3} $$  First, we show that the statement holds if a tournament $T$ has only 4 players. Actually, let $A=\left(a_{1}, a_{2}, a_{3}, a_{4}\right)$ be the number of wins of the players; we may assume that $a_{1} \geq a_{2} \geq a_{3} \geq a_{4}$. We have $a_{1}+a_{2}+a_{3}+a_{4}=\binom{4}{2}=6$, hence $a_{4} \leq 1$. If $a_{4}=0$, then we cannot have $a_{1}=a_{2}=a_{3}=2$, otherwise the company of all players is bad. Hence we should have $A=(3,2,1,0)$, and $S(T)=3^{3}+1^{3}+(-1)^{3}+(-3)^{3}=0$. On the other hand, if $a_{4}=1$, then only two possibilities, $A=(3,1,1,1)$ and $A=(2,2,1,1)$ can take place. In the former case we have $S(T)=3^{3}+3 \cdot(-2)^{3}>0$, while in the latter one $S(T)=1^{3}+1^{3}+(-1)^{3}+(-1)^{3}=0$, as desired.  Now we turn to the general problem. Consider a tournament $T$ with no bad companies and enumerate the players by the numbers from 1 to $n$. For every 4 players $i_{1}, i_{2}, i_{3}, i_{4}$ consider a "sub-tournament" $T_{i_{1} i_{2} i_{3} i_{4}}$ consisting of only these players and the games which they performed with each other. By the abovementioned, we have $S\left(T_{i_{1} i_{2} i_{3} i_{4}}\right) \geq 0$. Our aim is to prove that  $$ S(T)=\sum_{i_{1}, i_{2}, i_{3}, i_{4}} S\left(T_{i_{1} i_{2} i_{3} i_{4}}\right) $$  where the sum is taken over all 4 -tuples of distinct numbers from the set $\{1, \ldots, n\}$. This way the problem statement will be established.  We interpret the number $\left(w_{i}-\ell_{i}\right)^{3}$ as following. For $i \neq j$, let $\varepsilon_{i j}=1$ if the $i$ th player wins against the $j$ th one, and $\varepsilon_{i j}=-1$ otherwise. Then  $$ \left(w_{i}-\ell_{i}\right)^{3}=\left(\sum_{j \neq i} \varepsilon_{i j}\right)^{3}=\sum_{j_{1}, j_{2}, j_{3} \neq i} \varepsilon_{i j_{1}} \varepsilon_{i j_{2}} \varepsilon_{i j_{3}} . $$  Hence,  $$ S(T)=\sum_{i \notin\left\{j_{1}, j_{2}, j_{3}\right\}} \varepsilon_{i j_{1}} \varepsilon_{i j_{2}} \varepsilon_{i j_{3}} $$  To simplify this expression, consider all the terms in this sum where two indices are equal. If, for instance, $j_{1}=j_{2}$, then the term contains $\varepsilon_{i j_{1}}^{2}=1$, so we can replace this term by $\varepsilon_{i j_{3}}$. Make such replacements for each such term; obviously, after this change each term of the form $\varepsilon_{i j_{3}}$ will appear $P(T)$ times, hence  $$ S(T)=\sum_{\left|\left\{i, j_{1}, j_{2}, j_{3}\right\}\right|=4} \varepsilon_{i j_{1}} \varepsilon_{i j_{2}} \varepsilon_{i j_{3}}+P(T) \sum_{i \neq j} \varepsilon_{i j}=S_{1}(T)+P(T) S_{2}(T) $$  We show that $S_{2}(T)=0$ and hence $S(T)=S_{1}(T)$ for each tournament. Actually, note that $\varepsilon_{i j}=-\varepsilon_{j i}$, and the whole sum can be split into such pairs. Since the sum in each pair is 0 , so is $S_{2}(T)$.  Thus the desired equality (2) rewrites as  $$ S_{1}(T)=\sum_{i_{1}, i_{2}, i_{3}, i_{4}} S_{1}\left(T_{i_{1} i_{2} i_{3} i_{4}}\right) $$  Now, if all the numbers $j_{1}, j_{2}, j_{3}$ are distinct, then the set $\left\{i, j_{1}, j_{2}, j_{3}\right\}$ is contained in exactly one 4 -tuple, hence the term $\varepsilon_{i j_{1}} \varepsilon_{i j_{2}} \varepsilon_{i j_{3}}$ appears in the right-hand part of (3) exactly once, as well as in the left-hand part. Clearly, there are no other terms in both parts, so the equality is established.


Solution: Similarly to the first solution, we call the subsets of players as companies, and the $k$-element subsets will be called as $k$-companies.  In any company of the players, call a player the local champion of the company if he defeated all other members of the company. Similarly, if a player lost all his games against the others in the company then call him the local loser of the company. Obviously every company has at most one local champion and at most one local loser. By the condition of the problem, whenever a 4-company has a local loser, then this company has a local champion as well.  Suppose that $k$ is some positive integer, and let us count all cases when a player is the local champion of some $k$-company. The $i$ th player won against $w_{i}$ other player. To be the local champion of a $k$-company, he must be a member of the company, and the other $k-1$ members must be chosen from those whom he defeated. Therefore, the $i$ th player is the local champion of $\binom{w_{i}}{k-1} k$-companies. Hence, the total number of local champions of all $k$-companies is $\sum_{i=1}^{n}\binom{w_{i}}{k-1}$.  Similarly, the total number of local losers of the $k$-companies is $\sum_{i=1}^{n}\binom{\ell_{i}}{k-1}$. Now apply this for $k=2,3$ and 4. Since every game has a winner and a loser, we have $\sum_{i=1}^{n} w_{i}=\sum_{i=1}^{n} \ell_{i}=\binom{n}{2}$, and hence  $$ \sum_{i=1}^{n}\left(w_{i}-\ell_{i}\right)=0 $$  In every 3-company, either the players defeated one another in a cycle or the company has both a local champion and a local loser. Therefore, the total number of local champions and local losers in the 3-companies is the same, $\sum_{i=1}^{n}\binom{w_{i}}{2}=\sum_{i=1}^{n}\binom{\ell_{i}}{2}$. So we have  $$ \sum_{i=1}^{n}\left(\binom{w_{i}}{2}-\binom{\ell_{i}}{2}\right)=0 $$  In every 4-company, by the problem's condition, the number of local losers is less than or equal to the number of local champions. Then the same holds for the total numbers of local champions and local losers in all 4-companies, so $\sum_{i=1}^{n}\binom{w_{i}}{3} \geq \sum_{i=1}^{n}\binom{\ell_{i}}{3}$. Hence,  $$ \sum_{i=1}^{n}\left(\binom{w_{i}}{3}-\binom{\ell_{i}}{3}\right) \geq 0 $$  Now we establish the problem statement (1) as a linear combination of (4), (5) and (6). It is easy check that  $$ (x-y)^{3}=24\left(\binom{x}{3}-\binom{y}{3}\right)+24\left(\binom{x}{2}-\binom{y}{2}\right)-\left(3(x+y)^{2}-4\right)(x-y) $$  Apply this identity to $x=w_{1}$ and $y=\ell_{i}$. Since every player played $n-1$ games, we have $w_{i}+\ell_{i}=n-1$, and thus  $$ \left(w_{i}-\ell_{i}\right)^{3}=24\left(\binom{w_{i}}{3}-\binom{\ell_{i}}{3}\right)+24\left(\binom{w_{i}}{2}-\binom{\ell_{i}}{2}\right)-\left(3(n-1)^{2}-4\right)\left(w_{i}-\ell_{i}\right) $$  Then  $$ \sum_{i=1}^{n}\left(w_{i}-\ell_{i}\right)^{3}=24 \underbrace{\sum_{i=1}^{n}\left(\binom{w_{i}}{3}-\binom{\ell_{i}}{3}\right)}_{\geq 0}+24 \underbrace{\sum_{i=1}^{n}\left(\binom{w_{i}}{2}-\binom{\ell_{i}}{2}\right)}_{0}-\left(3(n-1)^{2}-4\right) \underbrace{\sum_{i=1}^{n}\left(w_{i}-\ell_{i}\right)}_{0} \geq 0 $$


Given a positive integer $k$ and other two integers $b>w>1$. There are two strings of pearls, a string of $b$ black pearls and a string of $w$ white pearls. The length of a string is the number of pearls on it.  One cuts these strings in some steps by the following rules. In each step: (i) The strings are ordered by their lengths in a non-increasing order. If there are some strings of equal lengths, then the white ones precede the black ones. Then $k$ first ones (if they consist of more than one pearl) are chosen; if there are less than $k$ strings longer than 1 , then one chooses all of them. (ii) Next, one cuts each chosen string into two parts differing in length by at most one. (For instance, if there are strings of $5,4,4,2$ black pearls, strings of $8,4,3$ white pearls and $k=4$, then the strings of 8 white, 5 black, 4 white and 4 black pearls are cut into the parts $(4,4),(3,2),(2,2)$ and $(2,2)$, respectively.)  The process stops immediately after the step when a first isolated white pearl appears. Prove that at this stage, there will still exist a string of at least two black pearls. (Canada)

Solution: Denote the situation after the $i$ th step by $A_{i}$; hence $A_{0}$ is the initial situation, and $A_{i-1} \rightarrow A_{i}$ is the $i$ th step. We call a string containing $m$ pearls an $m$-string; it is an $m$-w-string or a $m$-b-string if it is white or black, respectively.  We continue the process until every string consists of a single pearl. We will focus on three moments of the process: (a) the first stage $A_{s}$ when the first 1 -string (no matter black or white) appears; (b) the first stage $A_{t}$ where the total number of strings is greater than $k$ (if such moment does not appear then we put $t=\infty$ ); and (c) the first stage $A_{f}$ when all black pearls are isolated. It is sufficient to prove that in $A_{f-1}$ (or earlier), a 1-w-string appears.  We start with some easy properties of the situations under consideration. Obviously, we have $s \leq f$. Moreover, all b-strings from $A_{f-1}$ become single pearls in the $f$ th step, hence all of them are 1- or 2-b-strings.  Next, observe that in each step $A_{i} \rightarrow A_{i+1}$ with $i \leq t-1$, all $(>1)$-strings were cut since there are not more than $k$ strings at all; if, in addition, $i<s$, then there were no 1 -string, so all the strings were cut in this step.  Now, let $B_{i}$ and $b_{i}$ be the lengths of the longest and the shortest b-strings in $A_{i}$, and let $W_{i}$ and $w_{i}$ be the same for w-strings. We show by induction on $i \leq \min \{s, t\}$ that (i) the situation $A_{i}$ contains exactly $2^{i}$ black and $2^{i}$ white strings, (ii) $B_{i} \geq W_{i}$, and (iii) $b_{i} \geq w_{i}$. The base case $i=0$ is obvious. For the induction step, if $i \leq \min \{s, t\}$ then in the $i$ th step, each string is cut, thus the claim (i) follows from the induction hypothesis; next, we have $B_{i}=\left\lceil B_{i-1} / 2\right\rceil \geq\left\lceil W_{i-1} / 2\right\rceil=W_{i}$ and $b_{i}=\left\lfloor b_{i-1} / 2\right\rfloor \geq\left\lfloor w_{i-1} / 2\right\rfloor=w_{i}$, thus establishing (ii) and (iii).  For the numbers $s, t, f$, two cases are possible. Case 1. Suppose that $s \leq t$ or $f \leq t+1$ (and hence $s \leq t+1$ ); in particular, this is true when $t=\infty$. Then in $A_{s-1}$ we have $B_{s-1} \geq W_{s-1}, b_{s-1} \geq w_{s-1}>1$ as $s-1 \leq \min \{s, t\}$. Now, if $s=f$, then in $A_{s-1}$, there is no 1 -w-string as well as no ( $>2$ )-b-string. That is, $2=B_{s-1} \geq W_{s-1} \geq b_{s-1} \geq w_{s-1}>1$, hence all these numbers equal 2 . This means that in $A_{s-1}$, all strings contain 2 pearls, and there are $2^{s-1}$ black and $2^{s-1}$ white strings, which means $b=2 \cdot 2^{s-1}=w$. This contradicts the problem conditions.  Hence we have $s \leq f-1$ and thus $s \leq t$. Therefore, in the $s$ th step each string is cut into two parts. Now, if a 1-b-string appears in this step, then from $w_{s-1} \leq b_{s-1}$ we see that a  1-w-string appears as well; so, in each case in the sth step a 1-w-string appears, while not all black pearls become single, as desired.  Case 2. Now assume that $t+1 \leq s$ and $t+2 \leq f$. Then in $A_{t}$ we have exactly $2^{t}$ white and $2^{t}$ black strings, all being larger than 1 , and $2^{t+1}>k \geq 2^{t}$ (the latter holds since $2^{t}$ is the total number of strings in $A_{t-1}$ ). Now, in the $(t+1)$ st step, exactly $k$ strings are cut, not more than $2^{t}$ of them being black; so the number of w-strings in $A_{t+1}$ is at least $2^{t}+\left(k-2^{t}\right)=k$. Since the number of w-strings does not decrease in our process, in $A_{f-1}$ we have at least $k$ white strings as well.  Finally, in $A_{f-1}$, all b-strings are not larger than 2, and at least one 2-b-string is cut in the $f$ th step. Therefore, at most $k-1$ white strings are cut in this step, hence there exists a w-string $\mathcal{W}$ which is not cut in the $f$ th step. On the other hand, since a 2 -b-string is cut, all $(\geq 2)$-w-strings should also be cut in the $f$ th step; hence $\mathcal{W}$ should be a single pearl. This is exactly what we needed.  Comment. In this solution, we used the condition $b \neq w$ only to avoid the case $b=w=2^{t}$. Hence, if a number $b=w$ is not a power of 2 , then the problem statement is also valid.


Solution: We use the same notations as introduced in the first paragraph of the previous solution. We claim that at every stage, there exist a $u$-b-string and a $v$-w-string such that either (i) $u>v \geq 1$, or (ii) $2 \leq u \leq v<2 u$, and there also exist $k-1$ of ( $>v / 2$ )-strings other than considered above.  First, we notice that this statement implies the problem statement. Actually, in both cases (i) and (ii) we have $u>1$, so at each stage there exists a ( $\geq 2$ )-b-string, and for the last stage it is exactly what we need.  Now, we prove the claim by induction on the number of the stage. Obviously, for $A_{0}$ the condition (i) holds since $b>w$. Further, we suppose that the statement holds for $A_{i}$, and prove it for $A_{i+1}$. Two cases are possible.  Case 1. Assume that in $A_{i}$, there are a $u$-b-string and a $v$-w-string with $u>v$. We can assume that $v$ is the length of the shortest w-string in $A_{i}$; since we are not at the final stage, we have $v \geq 2$. Now, in the $(i+1)$ st step, two subcases may occur.  Subcase 1a. Suppose that either no $u$-b-string is cut, or both some $u$-b-string and some $v$-w-string are cut. Then in $A_{i+1}$, we have either a $u$-b-string and a $(\leq v)$-w-string (and (i) is valid), or we have a $\lceil u / 2\rceil$-b-string and a $\lfloor v / 2\rfloor$-w-string. In the latter case, from $u>v$ we get $\lceil u / 2\rceil>\lfloor v / 2\rfloor$, and (i) is valid again.  Subcase $1 b$. Now, some $u$-b-string is cut, and no $v$-w-string is cut (and hence all the strings which are cut are longer than $v$ ). If $u^{\prime}=\lceil u / 2\rceil>v$, then the condition (i) is satisfied since we have a $u^{\prime}$-b-string and a $v$-w-string in $A_{i+1}$. Otherwise, notice that the inequality $u>v \geq 2$ implies $u^{\prime} \geq 2$. Furthermore, besides a fixed $u$-b-string, other $k-1$ of $(\geq v+1)$-strings should be cut in the $(i+1)$ st step, hence providing at least $k-1$ of $(\geq\lceil(v+1) / 2\rceil)$-strings, and $\lceil(v+1) / 2\rceil>v / 2$. So, we can put $v^{\prime}=v$, and we have $u^{\prime} \leq v<u \leq 2 u^{\prime}$, so the condition (ii) holds for $A_{i+1}$.  Case 2. Conversely, assume that in $A_{i}$ there exist a $u$-b-string, a $v$-w-string $(2 \leq u \leq v<2 u)$ and a set $S$ of $k-1$ other strings larger than $v / 2$ (and hence larger than 1 ). In the ( $i+1$ )st step, three subcases may occur.  Subcase 2a. Suppose that some $u$-b-string is not cut, and some $v$-w-string is cut. The latter one results in a $\lfloor v / 2\rfloor$-w-string, we have $v^{\prime}=\lfloor v / 2\rfloor<u$, and the condition (i) is valid.  Subcase 2b. Next, suppose that no $v$-w-string is cut (and therefore no $u$-b-string is cut as $u \leq v$ ). Then all $k$ strings which are cut have the length $>v$, so each one results in a ( $>v / 2$ )string. Hence in $A_{i+1}$, there exist $k \geq k-1$ of $(>v / 2)$-strings other than the considered $u$ - and $v$-strings, and the condition (ii) is satisfied.  Subcase 2c. In the remaining case, all $u$-b-strings are cut. This means that all $(\geq u)$-strings are cut as well, hence our $v$-w-string is cut. Therefore in $A_{i+1}$ there exists a $\lceil u / 2\rceil$-b-string together with a $\lfloor v / 2\rfloor$-w-string. Now, if $u^{\prime}=\lceil u / 2\rceil>\lfloor v / 2\rfloor=v^{\prime}$ then the condition (i) is fulfilled. Otherwise, we have $u^{\prime} \leq v^{\prime}<u \leq 2 u^{\prime}$. In this case, we show that $u^{\prime} \geq 2$. If, to the contrary, $u^{\prime}=1$ (and hence $u=2$ ), then all black and white ( $\geq 2$ )-strings should be cut in the $(i+1)$ st step, and among these strings there are at least a $u$-b-string, a $v$-w-string, and $k-1$ strings in $S$ ( $k+1$ strings altogether). This is impossible.  Hence, we get $2 \leq u^{\prime} \leq v^{\prime}<2 u^{\prime}$. To reach (ii), it remains to check that in $A_{i+1}$, there exists a set $S^{\prime}$ of $k-1$ other strings larger than $v^{\prime} / 2$. These will be exactly the strings obtained from the elements of $S$. Namely, each $s \in S$ was either cut in the $(i+1)$ st step, or not. In the former case, let us include into $S^{\prime}$ the largest of the strings obtained from $s$; otherwise we include $s$ itself into $S^{\prime}$. All $k-1$ strings in $S^{\prime}$ are greater than $v / 2 \geq v^{\prime}$, as desired.


Let $P_{1}, \ldots, P_{s}$ be arithmetic progressions of integers, the following conditions being satisfied: (i) each integer belongs to at least one of them; (ii) each progression contains a number which does not belong to other progressions.  Denote by $n$ the least common multiple of steps of these progressions; let $n=p_{1}^{\alpha_{1}} \ldots p_{k}^{\alpha_{k}}$ be its prime factorization. Prove that  $$ s \geq 1+\sum_{i=1}^{k} \alpha_{i}\left(p_{i}-1\right) $$  (Germany)

Solution: First, we prove the key lemma, and then we show how to apply it to finish the solution.  Let $n_{1}, \ldots, n_{k}$ be positive integers. By an $n_{1} \times n_{2} \times \cdots \times n_{k}$ grid we mean the set $N=$ $\left\{\left(a_{1}, \ldots, a_{k}\right): a_{i} \in \mathbb{Z}, 0 \leq a_{i} \leq n_{i}-1\right\}$; the elements of $N$ will be referred to as points. In this grid, we define $a$ subgrid as a subset of the form  $$ L=\left\{\left(b_{1}, \ldots, b_{k}\right) \in N: b_{i_{1}}=x_{i_{1}}, \ldots, b_{i_{t}}=x_{i_{t}}\right\} $$  where $I=\left\{i_{1}, \ldots, i_{t}\right\}$ is an arbitrary nonempty set of indices, and $x_{i_{j}} \in\left[0, n_{i_{j}}-1\right](1 \leq j \leq t)$ are fixed integer numbers. Further, we say that a subgrid (1) is orthogonal to the $i$ th coordinate axis if $i \in I$, and that it is parallel to the $i$ th coordinate axis otherwise. Lemma. Assume that the grid $N$ is covered by subgrids $L_{1}, L_{2}, \ldots, L_{s}$ (this means $\left.N=\bigcup_{i=1}^{s} L_{i}\right)$ so that (ii') each subgrid contains a point which is not covered by other subgrids; (iii) for each coordinate axis, there exists a subgrid $L_{i}$ orthogonal to this axis.  Then  $$ s \geq 1+\sum_{i=1}^{k}\left(n_{i}-1\right) $$  Proof. Assume to the contrary that $s \leq \sum_{i}\left(n_{i}-1\right)=s^{\prime}$. Our aim is to find a point that is not covered by $L_{1}, \ldots, L_{s}$.  The idea of the proof is the following. Imagine that we expand each subgrid to some maximal subgrid so that for the $i$ th axis, there will be at most $n_{i}-1$ maximal subgrids orthogonal to this axis. Then the desired point can be found easily: its $i$ th coordinate should be that not covered by the maximal subgrids orthogonal to the $i$ th axis. Surely, the conditions for existence of such expansion are provided by Hall's lemma on matchings. So, we will follow this direction, although we will apply Hall's lemma to some subgraph instead of the whole graph.  Construct a bipartite graph $G=\left(V \cup V^{\prime}, E\right)$ as follows. Let $V=\left\{L_{1}, \ldots, L_{s}\right\}$, and let $V^{\prime}=\left\{v_{i j}: 1 \leq i \leq s, 1 \leq j \leq n_{i}-1\right\}$ be some set of $s^{\prime}$ elements. Further, let the edge ( $L_{m}, v_{i j}$ ) appear iff $L_{m}$ is orthogonal to the $i$ th axis.  For each subset $W \subset V$, denote  $$ f(W)=\left\{v \in V^{\prime}:(L, v) \in E \text { for some } L \in W\right\} $$  Notice that $f(V)=V^{\prime}$ by (iii). Now, consider the set $W \subset V$ containing the maximal number of elements such that $|W|>$ $|f(W)|$; if there is no such set then we set $W=\varnothing$. Denote $W^{\prime}=f(W), U=V \backslash W, U^{\prime}=V^{\prime} \backslash W^{\prime}$.  By our assumption and the Lemma condition, $|f(V)|=\left|V^{\prime}\right| \geq|V|$, hence $W \neq V$ and $U \neq \varnothing$. Permuting the coordinates, we can assume that $U^{\prime}=\left\{v_{i j}: 1 \leq i \leq \ell\right\}, W^{\prime}=\left\{v_{i j}: \ell+1 \leq i \leq k\right\}$.  Consider the induced subgraph $G^{\prime}$ of $G$ on the vertices $U \cup U^{\prime}$. We claim that for every $X \subset U$, we get $\left|f(X) \cap U^{\prime}\right| \geq|X|$ (so $G^{\prime}$ satisfies the conditions of Hall's lemma). Actually, we have $|W| \geq|f(W)|$, so if $|X|>\left|f(X) \cap U^{\prime}\right|$ for some $X \subset U$, then we have  $$ |W \cup X|=|W|+|X|>|f(W)|+\left|f(X) \cap U^{\prime}\right|=\left|f(W) \cup\left(f(X) \cap U^{\prime}\right)\right|=|f(W \cup X)| $$  This contradicts the maximality of $|W|$. Thus, applying Hall's lemma, we can assign to each $L \in U$ some vertex $v_{i j} \in U^{\prime}$ so that to distinct elements of $U$, distinct vertices of $U^{\prime}$ are assigned. In this situation, we say that $L \in U$ corresponds to the $i$ th axis, and write $g(L)=i$. Since there are $n_{i}-1$ vertices of the form $v_{i j}$, we get that for each $1 \leq i \leq \ell$, not more than $n_{i}-1$ subgrids correspond to the $i$ th axis.  Finally, we are ready to present the desired point. Since $W \neq V$, there exists a point $b=\left(b_{1}, b_{2}, \ldots, b_{k}\right) \in N \backslash\left(\cup_{L \in W} L\right)$. On the other hand, for every $1 \leq i \leq \ell$, consider any subgrid $L \in U$ with $g(L)=i$. This means exactly that $L$ is orthogonal to the $i$ th axis, and hence all its elements have the same $i$ th coordinate $c_{L}$. Since there are at most $n_{i}-1$ such subgrids, there exists a number $0 \leq a_{i} \leq n_{i}-1$ which is not contained in a set $\left\{c_{L}: g(L)=i\right\}$. Choose such number for every $1 \leq i \leq \ell$. Now we claim that point $a=\left(a_{1}, \ldots, a_{\ell}, b_{\ell+1}, \ldots, b_{k}\right)$ is not covered, hence contradicting the Lemma condition.  Surely, point $a$ cannot lie in some $L \in U$, since all the points in $L$ have $g(L)$ th coordinate $c_{L} \neq a_{g(L)}$. On the other hand, suppose that $a \in L$ for some $L \in W$; recall that $b \notin L$. But the points $a$ and $b$ differ only at first $\ell$ coordinates, so $L$ should be orthogonal to at least one of the first $\ell$ axes, and hence our graph contains some edge $\left(L, v_{i j}\right)$ for $i \leq \ell$. It contradicts the definition of $W^{\prime}$. The Lemma is proved.  Now we turn to the problem. Let $d_{j}$ be the step of the progression $P_{j}$. Note that since $n=$ l.c.m. $\left(d_{1}, \ldots, d_{s}\right)$, for each $1 \leq i \leq k$ there exists an index $j(i)$ such that $p_{i}^{\alpha_{i}} \mid d_{j(i)}$. We assume that $n>1$; otherwise the problem statement is trivial.  For each $0 \leq m \leq n-1$ and $1 \leq i \leq k$, let $m_{i}$ be the residue of $m$ modulo $p_{i}^{\alpha_{i}}$, and let $m_{i}=\overline{r_{i \alpha_{i}} \ldots r_{i 1}}$ be the base $p_{i}$ representation of $m_{i}$ (possibly, with some leading zeroes). Now, we put into correspondence to $m$ the sequence $r(m)=\left(r_{11}, \ldots, r_{1 \alpha_{1}}, r_{21}, \ldots, r_{k \alpha_{k}}\right)$. Hence $r(m)$ lies in a $\underbrace{p_{1} \times \cdots \times p_{1}}_{\alpha_{1} \text { times }} \times \cdots \times \underbrace{p_{k} \times \cdots \times p_{k}}_{\alpha_{k} \text { times }}$ grid $N$.  Surely, if $r(m)=r\left(m^{\prime}\right)$ then $p_{i}^{\alpha_{i}} \mid m_{i}-m_{i}^{\prime}$, which follows $p_{i}^{\alpha_{i}} \mid m-m^{\prime}$ for all $1 \leq i \leq k$; consequently, $n \mid m-m^{\prime}$. So, when $m$ runs over the set $\{0, \ldots, n-1\}$, the sequences $r(m)$ do not repeat; since $|N|=n$, this means that $r$ is a bijection between $\{0, \ldots, n-1\}$ and $N$. Now we will show that for each $1 \leq i \leq s$, the set $L_{i}=\left\{r(m): m \in P_{i}\right\}$ is a subgrid, and that for each axis there exists a subgrid orthogonal to this axis. Obviously, these subgrids cover $N$, and the condition (ii') follows directly from (ii). Hence the Lemma provides exactly the estimate we need.  Consider some $1 \leq j \leq s$ and let $d_{j}=p_{1}^{\gamma_{1}} \ldots p_{k}^{\gamma_{k}}$. Consider some $q \in P_{j}$ and let $r(q)=$ $\left(r_{11}, \ldots, r_{k \alpha_{k}}\right)$. Then for an arbitrary $q^{\prime}$, setting $r\left(q^{\prime}\right)=\left(r_{11}^{\prime}, \ldots, r_{k \alpha_{k}}^{\prime}\right)$ we have  $$ q^{\prime} \in P_{j} \quad \Longleftrightarrow \quad p_{i}^{\gamma_{i}} \mid q-q^{\prime} \text { for each } 1 \leq i \leq k \quad \Longleftrightarrow \quad r_{i, t}=r_{i, t}^{\prime} \text { for all } t \leq \gamma_{i} $$  Hence $L_{j}=\left\{\left(r_{11}^{\prime}, \ldots, r_{k \alpha_{k}}^{\prime}\right) \in N: r_{i, t}=r_{i, t}^{\prime}\right.$ for all $\left.t \leq \gamma_{i}\right\}$ which means that $L_{j}$ is a subgrid containing $r(q)$. Moreover, in $L_{j(i)}$, all the coordinates corresponding to $p_{i}$ are fixed, so it is orthogonal to all of their axes, as desired.  Comment 1. The estimate in the problem is sharp for every $n$. One of the possible examples is the following one. For each $1 \leq i \leq k, 0 \leq j \leq \alpha_{i}-1,1 \leq k \leq p-1$, let  $$ P_{i, j, k}=k p_{i}^{j}+p_{i}^{j+1} \mathbb{Z} $$  and add the progression $P_{0}=n \mathbb{Z}$. One can easily check that this set satisfies all the problem conditions. There also exist other examples.  On the other hand, the estimate can be adjusted in the following sense. For every $1 \leq i \leq k$, let $0=\alpha_{i 0}, \alpha_{i 1}, \ldots, \alpha_{i h_{i}}$ be all the numbers of the form $\operatorname{ord}_{p_{i}}\left(d_{j}\right)$ in an increasing order (we delete the repeating occurences of a number, and add a number $0=\alpha_{i 0}$ if it does not occur). Then, repeating the arguments from the solution one can obtain that  $$ s \geq 1+\sum_{i=1}^{k} \sum_{j=1}^{h_{i}}\left(p^{\alpha_{j}-\alpha_{j-1}}-1\right) $$  Note that $p^{\alpha}-1 \geq \alpha(p-1)$, and the equality is achieved only for $\alpha=1$. Hence, for reaching the minimal number of the progressions, one should have $\alpha_{i, j}=j$ for all $i, j$. In other words, for each $1 \leq j \leq \alpha_{i}$, there should be an index $t$ such that $\operatorname{ord}_{p_{i}}\left(d_{t}\right)=j$.


Solution: We start with introducing some notation. For positive integer $r$, we denote $[r]=\{1,2, \ldots, r\}$. Next, we say that a set of progressions $\mathcal{P}=\left\{P_{1}, \ldots, P_{s}\right\}$ cover $\mathbb{Z}$ if each integer belongs to some of them; we say that this covering is minimal if no proper subset of $\mathcal{P}$ covers $\mathbb{Z}$. Obviously, each covering contains a minimal subcovering.  Next, for a minimal covering $\left\{P_{1}, \ldots, P_{s}\right\}$ and for every $1 \leq i \leq s$, let $d_{i}$ be the step of progression $P_{i}$, and $h_{i}$ be some number which is contained in $P_{i}$ but in none of the other progressions. We assume that $n>1$, otherwise the problem is trivial. This implies $d_{i}>1$, otherwise the progression $P_{i}$ covers all the numbers, and $n=1$.  We will prove a more general statement, namely the following Claim. Assume that the progressions $P_{1}, \ldots, P_{s}$ and number $n=p_{1}^{\alpha_{1}} \ldots p_{k}^{\alpha_{k}}>1$ are chosen as in the problem statement. Moreover, choose some nonempty set of indices $I=\left\{i_{1}, \ldots, i_{t}\right\} \subseteq[k]$ and some positive integer $\beta_{i} \leq \alpha_{i}$ for every $i \in I$. Consider the set of indices  $$ T=\left\{j: 1 \leq j \leq s, \text { and } p_{i}^{\alpha_{i}-\beta_{i}+1} \mid d_{j} \text { for some } i \in I\right\} $$  Then  $$ |T| \geq 1+\sum_{i \in I} \beta_{i}\left(p_{i}-1\right) $$  Observe that the Claim for $I=[k]$ and $\beta_{i}=\alpha_{i}$ implies the problem statement, since the left-hand side in (2) is not greater than $s$. Hence, it suffices to prove the Claim.  1. First, we prove the Claim assuming that all $d_{j}$ 's are prime numbers. If for some $1 \leq i \leq k$ we have at least $p_{i}$ progressions with the step $p_{i}$, then they do not intersect and hence cover all the integers; it means that there are no other progressions, and $n=p_{i}$; the Claim is trivial in this case.  Now assume that for every $1 \leq i \leq k$, there are not more than $p_{i}-1$ progressions with step $p_{i}$; each such progression covers the numbers with a fixed residue modulo $p_{i}$, therefore there exists a residue $q_{i} \bmod p_{i}$ which is not touched by these progressions. By the Chinese Remainder Theorem, there exists a number $q$ such that $q \equiv q_{i}\left(\bmod p_{i}\right)$ for all $1 \leq i \leq k$; this number cannot be covered by any progression with step $p_{i}$, hence it is not covered at all. A contradiction. 2. Now, we assume that the general Claim is not valid, and hence we consider a counterexample $\left\{P_{1}, \ldots, P_{s}\right\}$ for the Claim; we can choose it to be minimal in the following sense:  - the number $n$ is minimal possible among all the counterexamples; - the sum $\sum_{i} d_{i}$ is minimal possible among all the counterexamples having the chosen value of $n$.  As was mentioned above, not all numbers $d_{i}$ are primes; hence we can assume that $d_{1}$ is composite, say $p_{1} \mid d_{1}$ and $d_{1}^{\prime}=\frac{d_{1}}{p_{1}}>1$. Consider a progression $P_{1}^{\prime}$ having the step $d_{1}^{\prime}$, and containing $P_{1}$. We will focus on two coverings constructed as follows. (i) Surely, the progressions $P_{1}^{\prime}, P_{2}, \ldots, P_{s}$ cover $\mathbb{Z}$, though this covering in not necessarily minimal. So, choose some minimal subcovering $\mathcal{P}^{\prime}$ in it; surely $P_{1}^{\prime} \in \mathcal{P}^{\prime}$ since $h_{1}$ is not covered by $P_{2}, \ldots, P_{s}$, so we may assume that $\mathcal{P}^{\prime}=\left\{P_{1}^{\prime}, P_{2}, \ldots, P_{s^{\prime}}\right\}$ for some $s^{\prime} \leq s$. Furthermore, the period of the covering $\mathcal{P}^{\prime}$ can appear to be less than $n$; so we denote this period by  $$ n^{\prime}=p_{1}^{\alpha_{1}-\sigma_{1}} \ldots p_{k}^{\alpha_{k}-\sigma_{k}}=\text { l.c.m. }\left(d_{1}^{\prime}, d_{2}, \ldots, d_{s^{\prime}}\right) $$  Observe that for each $P_{j} \notin \mathcal{P}^{\prime}$, we have $h_{j} \in P_{1}^{\prime}$, otherwise $h_{j}$ would not be covered by $\mathcal{P}$. (ii) On the other hand, each nonempty set of the form $R_{i}=P_{i} \cap P_{1}^{\prime}(1 \leq i \leq s)$ is also a progression with a step $r_{i}=$ l.c.m. $\left(d_{i}, d_{1}^{\prime}\right)$, and such sets cover $P_{1}^{\prime}$. Scaling these progressions with the ratio $1 / d_{1}^{\prime}$, we obtain the progressions $Q_{i}$ with steps $q_{i}=r_{i} / d_{1}^{\prime}$ which cover $\mathbb{Z}$. Now we choose a minimal subcovering $\mathcal{Q}$ of this covering; again we should have $Q_{1} \in \mathcal{Q}$ by the reasons of $h_{1}$. Now, denote the period of $\mathcal{Q}$ by  $$ n^{\prime \prime}=\text { l.c.m. }\left\{q_{i}: Q_{i} \in \mathcal{Q}\right\}=\frac{\text { l.c.m. }\left\{r_{i}: Q_{i} \in \mathcal{Q}\right\}}{d_{1}^{\prime}}=\frac{p_{1}^{\gamma_{1}} \ldots p_{k}^{\gamma_{k}}}{d_{1}^{\prime}} $$  Note that if $h_{j} \in P_{1}^{\prime}$, then the image of $h_{j}$ under the scaling can be covered by $Q_{j}$ only; so, in this case we have $Q_{j} \in \mathcal{Q}$.  Our aim is to find the desired number of progressions in coverings $\mathcal{P}$ and $\mathcal{Q}$. First, we have $n \geq n^{\prime}$, and the sum of the steps in $\mathcal{P}^{\prime}$ is less than that in $\mathcal{P}$; hence the Claim is valid for $\mathcal{P}^{\prime}$. We apply it to the set of indices $I^{\prime}=\left\{i \in I: \beta_{i}>\sigma_{i}\right\}$ and the exponents $\beta_{i}^{\prime}=\beta_{i}-\sigma_{i}$; hence the set under consideration is  $$ T^{\prime}=\left\{j: 1 \leq j \leq s^{\prime}, \text { and } p_{i}^{\left(\alpha_{i}-\sigma_{i}\right)-\beta_{i}^{\prime}+1}=p_{i}^{\alpha_{i}-\beta_{i}+1} \mid d_{j} \text { for some } i \in I^{\prime}\right\} \subseteq T \cap\left[s^{\prime}\right], $$  and we obtain that  $$ \left|T \cap\left[s^{\prime}\right]\right| \geq\left|T^{\prime}\right| \geq 1+\sum_{i \in I^{\prime}}\left(\beta_{i}-\sigma_{i}\right)\left(p_{i}-1\right)=1+\sum_{i \in I}\left(\beta_{i}-\sigma_{i}\right)_{+}\left(p_{i}-1\right) $$  where $(x)_{+}=\max \{x, 0\}$; the latter equality holds as for $i \notin I^{\prime}$ we have $\beta_{i} \leq \sigma_{i}$. Observe that $x=(x-y)_{+}+\min \{x, y\}$ for all $x, y$. So, if we find at least  $$ G=\sum_{i \in I} \min \left\{\beta_{i}, \sigma_{i}\right\}\left(p_{i}-1\right) $$  indices in $T \cap\left\{s^{\prime}+1, \ldots, s\right\}$, then we would have  $$ |T|=\left|T \cap\left[s^{\prime}\right]\right|+\left|T \cap\left\{s^{\prime}+1, \ldots, s\right\}\right| \geq 1+\sum_{i \in I}\left(\left(\beta_{i}-\sigma_{i}\right)_{+}+\min \left\{\beta_{i}, \sigma_{i}\right\}\right)\left(p_{i}-1\right)=1+\sum_{i \in I} \beta_{i}\left(p_{i}-1\right) $$  thus leading to a contradiction with the choice of $\mathcal{P}$. We will find those indices among the indices of progressions in $\mathcal{Q}$. 3. Now denote $I^{\prime \prime}=\left\{i \in I: \sigma_{i}>0\right\}$ and consider some $i \in I^{\prime \prime}$; then $p_{i}^{\alpha_{i}} \nmid n^{\prime}$. On the other hand, there exists an index $j(i)$ such that $p_{i}^{\alpha_{i}} \mid d_{j(i)}$; this means that $d_{j(i)} \backslash n^{\prime}$ and hence $P_{j(i)}$ cannot appear in $\mathcal{P}^{\prime}$, so $j(i)>s^{\prime}$. Moreover, we have observed before that in this case $h_{j(i)} \in P_{1}^{\prime}$, hence $Q_{j(i)} \in \mathcal{Q}$. This means that $q_{j(i)} \mid n^{\prime \prime}$, therefore $\gamma_{i}=\alpha_{i}$ for each $i \in I^{\prime \prime}$ (recall here that $q_{i}=r_{i} / d_{1}^{\prime}$ and hence $\left.d_{j(i)}\left|r_{j(i)}\right| d_{1}^{\prime} n^{\prime \prime}\right)$.  Let $d_{1}^{\prime}=p_{1}^{\tau_{1}} \ldots p_{k}^{\tau_{k}}$. Then $n^{\prime \prime}=p_{1}^{\gamma_{1}-\tau_{1}} \ldots p_{k}^{\gamma_{i}-\tau_{i}}$. Now, if $i \in I^{\prime \prime}$, then for every $\beta$ the condition $p_{i}^{\left(\gamma_{i}-\tau_{i}\right)-\beta+1} \mid q_{j}$ is equivalent to $p_{i}^{\alpha_{i}-\beta+1} \mid r_{j}$.  Note that $n^{\prime \prime} \leq n / d_{1}^{\prime}<n$, hence we can apply the Claim to the covering $\mathcal{Q}$. We perform this with the set of indices $I^{\prime \prime}$ and the exponents $\beta_{i}^{\prime \prime}=\min \left\{\beta_{i}, \sigma_{i}\right\}>0$. So, the set under consideration is  $$ \begin{aligned} T^{\prime \prime} & =\left\{j: Q_{j} \in \mathcal{Q}, \text { and } p_{i}^{\left(\gamma_{i}-\tau_{i}\right)-\min \left\{\beta_{i}, \sigma_{i}\right\}+1} \mid q_{j} \text { for some } i \in I^{\prime \prime}\right\} \\ & =\left\{j: Q_{j} \in \mathcal{Q}, \text { and } p_{i}^{\alpha_{i}-\min \left\{\beta_{i}, \sigma_{i}\right\}+1} \mid r_{j} \text { for some } i \in I^{\prime \prime}\right\}, \end{aligned} $$  and we obtain $\left|T^{\prime \prime}\right| \geq 1+G$. Finally, we claim that $T^{\prime \prime} \subseteq T \cap\left(\{1\} \cup\left\{s^{\prime}+1, \ldots, s\right\}\right)$; then we will obtain $\left|T \cap\left\{s^{\prime}+1, \ldots, s\right\}\right| \geq G$, which is exactly what we need.  To prove this, consider any $j \in T^{\prime \prime}$. Observe first that $\alpha_{i}-\min \left\{\beta_{i}, \sigma_{i}\right\}+1>\alpha_{i}-\sigma_{i} \geq \tau_{i}$, hence from $p_{i}^{\alpha_{i}-\min \left\{\beta_{i}, \sigma_{i}\right\}+1} \mid r_{j}=$ l.c.m. $\left(d_{1}^{\prime}, d_{j}\right)$ we have $p_{i}^{\alpha_{i}-\min \left\{\beta_{i}, \sigma_{i}\right\}+1} \mid d_{j}$, which means that $j \in T$. Next, the exponent of $p_{i}$ in $d_{j}$ is greater than that in $n^{\prime}$, which means that $P_{j} \notin \mathcal{P}^{\prime}$. This may appear only if $j=1$ or $j>s^{\prime}$, as desired. This completes the proof.  Comment 2. A grid analogue of the Claim is also valid. It reads as following. Claim. Assume that the grid $N$ is covered by subgrids $L_{1}, L_{2}, \ldots, L_{s}$ so that (ii') each subgrid contains a point which is not covered by other subgrids; (iii) for each coordinate axis, there exists a subgrid $L_{i}$ orthogonal to this axis.  Choose some set of indices $I=\left\{i_{1}, \ldots, i_{t}\right\} \subset[k]$, and consider the set of indices  $$ T=\left\{j: 1 \leq j \leq s \text {, and } L_{j} \text { is orthogonal to the } i \text { th axis for some } i \in I\right\} $$  Then  $$ |T| \geq 1+\sum_{i \in I}\left(n_{i}-1\right) $$  This Claim may be proved almost in the same way as in Solution 1.