solution:
Let us prove that $n=S(n)+9 T(n)$ proceding by induction over the number of digits of $n$.
1 POINT.
If $n$ has one digit then the result is trivial. Suppose that $n=S(n)+9 T(n)$ is true for any integer $n$ of $k$ digits. Now any number $m$ of $k+1$ digits can be writen as $m=10 n+a$ where $n$ is a number of $k$ digits. Obviously,

$$
\begin{aligned}
T(m)=n+T(n) & \text { and }(m)=S(n)+a \\
& 2 \text { POINTS (1 POINT for each of the last equalities). }
\end{aligned}
$$

Therefore

$$
\begin{aligned}
m-S(m) & =10 n+a-S(n)-a \\
& =10 n-S(n) \\
& =(n-S(n))+9 n \\
& =9 T(n)+9 n \\
& =9 T(m)
\end{aligned}
$$

as required.
\& POINTS.

problem_match: # Problem 1.

solution_match: # First solution.


solution:
Let $n=\overline{a_{k} a_{k-1} \ldots a_{1} a_{0}}=10^{k} a_{k}+10^{k-1} a_{k-1}+\ldots+10 a_{1}+a_{0}$, where $a_{k}, a_{k-1}, \ldots, a_{1}, a_{0}$ are digits. The stumps of $n$ are

$$
\begin{aligned}
\overline{a_{k} a_{k-1} \cdots a_{1}} & =10^{k-1} a_{k}+10^{k-2} a_{k-1}+\ldots+10 a_{2}+a_{1} \\
\overline{a_{k} a_{k-1} \cdots a_{2}} & =10^{k-2} a_{k}+10^{k-3} a_{k-1}+\ldots+a_{2} \\
& \vdots \\
\overline{a_{k} a_{k-1}} & =10 a_{k}+a_{k-1} \\
a_{k} & =a_{k} .
\end{aligned}
$$

1 POINT.
Since $10^{m-1}+10^{m-2}+\ldots+10+1=\frac{10^{m}-1}{9}$ then the sum of all stumps of $n$ is

$$
T(n)=\frac{10^{k}-1}{9} a_{k}+\frac{10^{k-1}-1}{9} a_{k-1}+\ldots+\frac{10-1}{9} a_{1}
$$

3 POINTS.
and hence

$$
\begin{aligned}
9 T(n) & =10^{k} a_{k}+10^{k-1} a_{k-1}+\ldots+10 a_{1}+a_{0}-\left(a_{k}+a_{k-1}+\ldots+a_{1}+a_{0}\right) \\
& =n-S(n) .
\end{aligned}
$$

Consequently $n=S(n)+9 T(n)$.
3 POINTS.

solution_match: # Second solution.


solution:
Let $k(n)$ be the number of zeros at the end of the decimal representation of $n$ or, which is the same, the largest power of 10 which divides $n$. The the following two observations are straightforward:

1. $S(n)=S(n-1)-(9 k(n)-1)$,
2. $k(1)+k(2)+\ldots+k(n)=T(n)$.

4 POINTS (2 POINTS for each of these equalities).
Then summing the following equalities up

$$
\begin{aligned}
S(1) & =S(0)-(9 k(1)-1), \\
S(2) & =S(1)-(9 k(2)-1), \\
& \vdots \\
S(n-1) & =S(n-2)-(9 k(n-1)-1) \\
S(n) & =S(n-1)-(9 k(n-1)-1)
\end{aligned}
$$

we get $S(n)=n-(k(1)+k(2)+\ldots+k(n))=n-9 T(n)$.
3 POINT for concluding.

solution_match: # Third Solution.


solution:
This is equivalent to find the largest positive integer solution of the equation

$$
\left\lfloor\frac{N}{3}\right\rfloor=\left\lfloor\frac{N}{5}\right\rfloor+\left\lfloor\frac{N}{7}\right\rfloor-\left\lfloor\frac{N}{35}\right\rfloor
$$

or

$$
\left\lfloor\frac{N}{3}\right\rfloor+\left\lfloor\frac{N}{35}\right\rfloor=\left\lfloor\frac{N}{5}\right\rfloor+\left\lfloor\left\lfloor\frac{N}{7}\right\rfloor .\right.
$$

1 POINT for equality (1).
For $N$ to be a solution of (1) it is necessary that

$$
\frac{N-2}{3}+\frac{N-34}{35} \leq \frac{N}{5}+\frac{N}{7}
$$

which simplifies to $N \leq 86$.
1 POINTS for finding that $N \leq 86$.
However, if $N \geq 70$ then because $N \leq 86$, (1) implies that

$$
\frac{N-2}{3}+\frac{N-16}{35} \leq \frac{N}{5}+\frac{N}{7}
$$

which simplifies to $N \leq 59$, contradicting $N \geq 70$. it follows that $N$ must be at most 69 .
4 POINTS for finding that $N \leq 69$.
Checking (1) for $N \leq 69$ we find that

$$
\begin{array}{llll}
\text { when } \quad N=69, & \text { (1) is } & 23+1=13+9, & \text { false } \\
\text { when } N=68,67,66, & \text { (1) is } 22+1=13+9, & \text { false } \\
\text { when } N=65, & \text { (1) is } 21+1=13+9, & \text { true. }
\end{array}
$$

Thus the answer is $N=65$.
1 POINT for concluding.

problem_match: # Problem 2.

solution_match: # First Solution.


solution:
This is equivalent to find the largest positive integer solution of the equation

$$
\left\lfloor\frac{N}{3}\right\rfloor=\left\lfloor\frac{N}{5}\right\rfloor+\left\lfloor\frac{N}{7}\right\rfloor-\left\lfloor\frac{N}{35}\right\rfloor,
$$

Let $N=35 k+r(0 \leq r<35)$ be a solution of (1). Then (1) can be writen as

$$
\left\lfloor\frac{35 k+r}{3}\right\rfloor=11 k+\left\lfloor\frac{r}{5}\right\rfloor+\left\lfloor\frac{r}{7}\right\rfloor .
$$

Now $\quad \frac{35 k+r-2}{3} \leq\left\lfloor\frac{35 k+r}{3}\right\rfloor,\left\lfloor\frac{r}{5}\right\rfloor \leq \frac{r}{5}$ and $\left\lfloor\frac{r}{7}\right\rfloor \leq \frac{\tau}{7}$. Therefore r

$$
\frac{35 k+r-2}{3} \leq 11 k+\frac{r}{5}+\frac{r}{7}=\frac{12 r}{35}
$$

which implies that $70 k \leq r+70<35+70=105$. Then $k \leq 1$ or equivalently $N \leq 69$.
4 POINTS for finding that $N \leq 69$.
As in the first solution, checking (1) for $N \leq 69$ we find the answer $N=65$.

## 1 POINT for concluding.

## Remark.

2 POINTS can be given for finding a good upper bound for example $N \leq 100$ (in the first solution we found $n \leq 86$ ). 6 POINTS for proving that $N \leq 69$.
1 POINT can be given for the correct answer.


solution:
It is easy to see that the intersection $S \cap T$ has $2 n$ sides only if the sides of $S \cap T$ alternate: blue, red, blue, red, etc.

## 1 POINT.

Denote the vertices of $S \cap T$ clockwise as $C_{1} D_{1} C_{2} D_{2} \ldots C_{n} D_{n}$ so that the sides $C_{1} D_{1}, C_{2} D_{2}, \ldots C_{n} D_{n}$ are blue. Denote the vertices of $S$ by $A_{1}, A_{2}, \ldots, A_{n}$ and the vertices of $T$ by $B_{1}, B_{2}, \ldots, B_{n}$ so that $C_{1} D_{1} \subset B_{1} B_{2}, \ldots, C_{n} D_{n} \subset B_{n} B_{1}$ and $D_{n} C_{1} \subset A_{1} A_{2}, \ldots, D_{n-1} C_{n} \subset A_{n} A_{1}$.
It is easy to check that all the triangles $D_{n} B_{1} C_{1}, D_{1} B_{2} C_{2}, \ldots, D_{n-1} B_{n} C_{n}$ and $C_{1} A_{2} D_{1}, C_{2} A_{3} D_{2}, \ldots, C_{n} A_{1} D_{n}$ are similar.

## 1 POINT.

Therefore,

$$
\begin{gathered}
\frac{D_{n} C_{1}}{D_{n} B_{1}+B_{1} C_{1}}=\frac{D_{1} C_{2}}{D_{1} B_{2}+B_{2} C_{2}}=\ldots=\frac{D_{n-1} C_{n}}{D_{n-1} B_{n}+B_{n} C_{n}}= \\
=\frac{C_{1} D_{1}}{C_{1} A_{2}+A_{2} D_{1}}=\frac{C_{1} D_{2}}{C_{2} A_{3}+A_{3} D_{2}}=\ldots=\frac{C_{n} D_{n}}{C_{n} A_{1}+A_{1} D_{n}}
\end{gathered}
$$

1 POINT.
Hence,

$$
\frac{D_{n} C_{1}+D_{1} C_{2}+\ldots+D_{n-1} C_{n}}{D_{n} B_{1}+B_{1} C_{1}+D_{1} B_{2}+B_{2} C_{2}+\ldots+D_{n-1} B_{n}+B_{n} C_{n}}=
$$

$$
=\frac{C_{1} D_{1}+C_{1} D_{2}+\ldots+C_{n} D_{n}}{C_{1} A_{2}+A_{2} D_{1}+C_{2} A_{3}+A_{3} D_{2}+\ldots+C_{n} A_{1}+A_{1} D_{n}}
$$

Let $x=D_{n} C_{1}+D_{1} C_{2}+\ldots+D_{n-1} C_{n}$ and $y=C_{1} D_{1}+C_{1} \tilde{D}_{2}+\ldots+C_{n} D_{n}$ then $x$ is the sum of the blue sides of $S \cap T$ and $y$ is the sum of the red sides. If $a$ is the length of a side of $S$ (or $T$ ), then the equality (1) can be written in the following form

$$
\frac{x}{n a-y}=\frac{y}{n a-x} .
$$

It follows that

$$
\begin{aligned}
n a x-x^{2} & =n a y-y^{2} \\
n a(x-y) & =(x+y)(x-y) \\
(n a-x-y)(x-y) & =0
\end{aligned}
$$

Since the perimeter $x+y$ of $S \cap T$ is strictly less than the perimeter $n a$ of $S$ or $T, n a-x-y>0$. We obtain $x-y=0$ and $x=y$ q.e.d.

4 POINTS for concluding.

problem_match: # Problem 3.


solution:
As in the first solution, $S \cap T$ has $2 n$ sides only if the sides of $S \cap T$ alternate.
1 POINT.
Label the vertices of the red $n$-gon $R_{1}, R_{2}, \ldots R_{n}$ and the vertices of the blue $n$-gon $B_{1}, B_{2}, \ldots, B_{n}$. Place the $n$-gons so that the vertices are in the following clockwise order: $B_{1}, R_{1}, B_{2}, R_{2}, \ldots, B_{n}, R_{n}$. Each of these vertices together with the opposite side determines a triangle and all these triangles are similar.

1 POINT.
For each $i=1, \ldots, n$, we let the lengths of the sides of the triangle determined by $B_{i}$ be $b_{i}, c_{i}, d_{i}$ in the clockwise order where $b_{i}$ is the side opposite $B_{i}$ such that $b_{i} / b_{1}=c_{i} / c_{1}=d_{i} / d_{1}=p_{i}$. We also let the lengths of the sides of the triangle determined by $R_{i}$ be $r_{i}, s_{i}, t_{i}$ in the counter clockwise order such that $r_{i} / b_{1}=s_{i} / c_{1}=t_{i} / d_{1}=q_{i}$.

1 POINT.
Then we want to prove that $b_{1}+\cdots+b_{n}=r_{1}+\cdots+r_{n}$ or $b_{1}\left(p_{1}+\cdots+p_{n}\right)=b_{1}\left(q_{1}+\cdots+q_{n}\right)$, where $p_{1}=1$, or $p=q$ where $p=\left(p_{1}+\cdots+p_{n}\right), q=\left(q_{1}+\cdots+q_{n}\right)$. The perimeter of the blue $n$-gon is $c_{1}+d_{1}+r_{1}+\cdots+c_{n}+d_{n}+r_{n}=p c_{1}+p d_{1}+q b_{1}$. Likewise the perimeter of the red $n$ gon is $p b_{1}+q c_{1}+q d_{1}$. Equating the two we have $p\left(c_{1}+d_{1}-b_{1}\right)=q\left(c_{1}+d_{1}-b_{1}\right)$, which implies $p=q$ as
required.
![](https://cdn.mathpix.com/cropped/2024_11_22_d0bd4d1accc9b46debb3g-06.jpg?height=440&width=1134&top_left_y=555&top_left_x=753)

solution_match: # Second Solution.


problem: Answer. All the polynomials of degree 1 with rational coefficients.

solution:
Note that a polynomial that satisfies the conditions of the problem takes rational values for rational numbers and irrational values for irrational numbers. Let $f(x)$ be a polynomial of degree $n$ such that $f(r) \in Q$ for every $r \in Q$. For distinct rational numbers $r_{0}, r_{1}, \ldots, r_{n}$, where $n=\operatorname{deg} f(x)$ let us define the polynomial

$$
\begin{aligned}
g(x)= & c_{0}\left(x-r_{1}\right)\left(x-r_{2}\right) \ldots\left(x-r_{n}\right)+c_{1}\left(x-r_{0}\right)\left(x-r_{2}\right) \ldots\left(x-r_{n}\right)+\ldots \\
& +c_{i}\left(x-r_{0}\right) \ldots\left(x-r_{i-1}\right)\left(x-r_{i+1}\right) \ldots\left(x-r_{n}\right)+\ldots \\
& +c_{n}\left(x-r_{0}\right)\left(x-r_{1}\right) \ldots\left(x-r_{n-1}\right)
\end{aligned}
$$

where $c_{0}, c_{1}, \ldots, c_{n}$ are real numbers.
Suppose that $g\left(r_{i}\right)=f\left(r_{i}\right), i=0,1, \ldots, n$. Since $g\left(r_{i}\right)=c_{i}\left(r_{i}-r_{0}\right) \ldots\left(r_{i}-r_{i-1}\right)\left(r_{i}-r_{i+1}\right) \ldots\left(r_{i}-r_{n}\right)$ then

$$
c_{i}=\frac{g\left(r_{i}\right)}{\left(r_{i}-r_{0}\right) \ldots\left(r_{i}-r_{i-1}\right)\left(r_{i}-r_{i+1}\right)}=\frac{f\left(r_{i}\right)}{\left(r_{i}-r_{0}\right) \ldots\left(r_{i}-r_{i-1}\right)\left(r_{i}-r_{i+1}\right)} .
$$

Clearly $c_{i}$ is a rational number for $i=0,1, \ldots, n$ and therefore the coefficients of $g(x)$ are rational. The polynomial $g(x)$ defined in (1) with coefficients $c_{0}, c_{1}, \ldots, c_{n}$ satisfying (2) coincides with $f(x)$ in $n+1$ points and both polynomials $f$ and $g$ have degree $n$. It follows that for every real $x, f(x)=g(x)$. Therefore the coefficients of $f(x)$ are rational.
Thus if a polynomial satisfies the conditions, all its coefficients are rational.
1 POINT for proving that the polinomial has rational coefficients.
It is easy to see that all the polynomials of first degree with rational coefficients satisfy the conditions of the problem and polynomials of degree 0 do not satisfy it. Let us prove that no other polynomials exist.

Suppose that $f(x)=a_{0}+a_{1} x+\ldots+a_{n} x^{n}$ is a polynomial with rational coefficients and degree $n \geq 2$ that satisfies the conditions of the problem. We may assume that the coefficients of $f(x)$ are integers, because the sets of solutions of equations $f(x)=r$ and $a f^{\prime}(x)=a r$, where $a$ is an integer, coincide. Moreover let us denote $g(x)=a_{n}^{n-1} f\left(\frac{x}{a_{n}}\right) \cdot g(x)$ is a polynomial with integer coefficients whose leading coefficient is 1 . The equation $f(x)=r$ has an irrational root if and only if $g(x)=a_{n}^{n-1} r$ has an irrational root. Therefore, we may assume WLOG that $f(x)$ has integer coefficients and $a_{n}=1$.

1 POINT more for proving that it is suficient to consider polinomials with integer and leading coefficient equal to 1 .

Let $r$ be a sufficiently large prime, such that

$$
r>\max \left\{f(1)-f(0), x_{1}, x_{2}, \ldots, x_{k}\right\}
$$

where $\left\{x_{1}, x_{2}, \ldots, x_{k}\right\}$ denote the set of all real roots of $f(x)-f(0)-x=0$. Putting $q=r+f(0) \in Z$, and considering the equality

$$
f(x)-q=f(x)-f(0)-r
$$

we then have

$$
f(1)-q=f(1)-f(0)-r<0 .
$$

On the other hand, by the choice of $r$, we have

$$
f(1)-q=f(r)-f(0)-r>0 .
$$

It follows from the intermediate value theorem that there is at least one real root $p$ of $f(x)-q=0$ between 1 and $r$. Notice that from the criterion theorem for rational roots, the possible positive rational roots of the equation $f(x)-q=f(x)-f(0)-r=0$ are 1 and $r$. Thus $p$ must be irrational.

## 5 POINTS for concluding.

problem_match: # Problem 4.


solution:
As in the first solution we may assume WLOG that $f(x)$ has integer coefficients and the leading coefficient is $a_{n}=1$.

2 POINTS.
Observing the graph of $f(x)$, it is easy to see that there exists a sufficiently great integer $r$ such that $f(x)=r$ has one possitive root $x_{0}$ and for $x \geq x_{0}$ the derivative $f^{\prime}(x)$ is greater than 1 . The equation $f(x)=r+1$ has also one positive root $x_{1}>x_{0}$. Since $a_{n}=1$, rational roots $x_{0}$ and $x_{1}$ must be integers. Then $x_{1}-x_{0} \geq 1$ and

$$
\frac{f\left(x_{1}\right)-f\left(x_{0}\right)}{x_{1}-x_{0}} \leq 1
$$

It follows that $f^{\prime}(z)<1$ for $z \in\left[x_{0}, x_{1}\right]$. This contradiction proves that $f(x)=r$ necessarily has an irrational root for at least one integer $r$.

## Remark.

No points can be given just for the answer.


solution:
One of the sides $A X_{i}$ or $B X_{i}$ is equal to $C D$, thus $X_{i}$ is on one of the circles of radius $C D$ and center $A$ or $B$. In the same way $X_{i}$ is on one of circles of radius $A B$ with center $C$ or $D$. The intersection of these four circles has no more than 8 points so that $n \leq 8$.

## 1 POINT for finding that $n \leq 8$.

Suppose that circle $S_{B}$ with center $B$ and radius $C D$ intersects circle $S_{C}$ with center $C$ and radius $A B$ in two points $X_{1}$ and $X_{2}$ which satisfy the conditions of the problem. Then in triangles $A B X_{1}$ and $C D X_{1}$ we have $B X_{1}=C D$ and $C X_{1}=A B$. Since these triangles are congruent then $A X_{1}=$ $D X_{1}$, therefore $X_{1}$ and $X_{2}$ are on the perpendicular bisector of $A D$. On the other hand $X_{1} X_{2}$ is perpendicular to segment $B C$. Then $B C \| A D$ and $A B$ and $C D$ are the diagonals or nonparallel sides of a trapezoid.
![](https://cdn.mathpix.com/cropped/2024_11_22_d0bd4d1accc9b46debb3g-08.jpg?height=302&width=513&top_left_y=1193&top_left_x=795)

Suppose that $A B<C D$. Then $B X_{1}=C D>A B=C X_{1}$. It follows that the distance from $A$ to the perpendicular bisector of $B C$ must be less than the distance from $D$ to this line otherwise we obtain a contradiction to the condition $A B<C D$. Then for any point $X$ in the perpendicular bisector of $B C$ we have $A X<D X$ and it is not possible to have $A X=C D, D X=A B$. Thus if the circle with center $A$ and radius $C D$ intersects the circle with center $D$ and radius $A B$, then the points of intersection do not satisfy the condition of congruence. Therefore if the points of intersection of $S_{B}$ with $S_{C}$ satisfy the condition of congruence, then the points of intersection of $S_{A}$ with $S_{D}$ do not. Thus no more than half of the 8 points of intersection of these circles can satisfy the condition of congruence, i.e. $n \leq 4$.

4 POINTS for proving that $n \leq 4$.
If $n=4$ we have the following example of a regular hexagon.
![](https://cdn.mathpix.com/cropped/2024_11_22_d0bd4d1accc9b46debb3g-08.jpg?height=310&width=489&top_left_y=2070&top_left_x=815)

2 POINTS for proving that $n \geq 4$.

problem_match: # Problem 5.


solution:
The greatest possible value of $n$ is 4 . First we will prover that $n \geq 4$ and finally we will prove that $n \leq 4$.

- To prove that $n \geq 4$ it is enough to show a configuration of 8 points that satisfies the conditions of the problem. Let us choose 6 points $A, B, Y, C, D, X$ on a circle such that triangle $A Y D$ is equilateral and $B, C, X$ are points on arcs $A Y, Y D, D A$ respectively, such that arcs $A B, Y C, D X$ are equal and less than $60^{\circ}$. Then it is easy to see that $A B, C D$ and $X Y$ are parallel and $\angle D X Y=\angle C Y X=60^{\circ}$.
![](https://cdn.mathpix.com/cropped/2024_11_22_d0bd4d1accc9b46debb3g-09.jpg?height=282&width=347&top_left_y=954&top_left_x=889)

If $X Y$ intersects $A C$ and $B D$ at $X^{\prime}, Y^{\prime}$, respectively, then $X, Y, X^{\prime} Y^{\prime}$ satisfy the conditions of the problem.

2 POINTS for proving that $n \geq 4$.

- To show that $n \leq 4$ let us consider the following figure.
![](https://cdn.mathpix.com/cropped/2024_11_22_d0bd4d1accc9b46debb3g-09.jpg?height=508&width=611&top_left_y=1546&top_left_x=849)

Suppose that $A B<C D$. The trace of point $K$ such that $(A B K)=(C D K)$ is two lines $l$ and $m$ through the point of intersection $O$ of $A B$ with $C D$. (If $A B \| C D$ then the trace of $K$ is formed by two parallel lines.)
If $X$ is a point such that $\triangle A B X \cong \triangle C D X$ then $X$ must be on one or more of the perpendicular bisectors of the segments $A C, A D, B C, B D$. Since $X$ lies on $l$ or $m$, on each of the perpendicular bisectors of $A C, A D, B C, B D$ there can be no more than 2 intersection points, i.e. $n \leq 8$.

1 POINT for proving that $n \leq 8$.
We will prove that at most one point on each perpendicular bisector satisfies the conditions of the problem.

WLOG Suposse that $X_{1}$ and $X_{2}$ are points on the perpendicular bisector of $B C$ such that $\triangle A B X_{1} \cong \triangle C D X_{1}$ and $\triangle A B X_{2} \cong \triangle C D X_{2}$ with $X_{1} \in l$ and $X_{2} \in m$.
Let us prove that $A X_{1}=C D$. Since $A B \neq C D$ one of the segments $A X_{1}$ or $B X_{1}$ is equal to $C D$. If $B X_{1}=C D$ then $C X_{1}=C D$ by construction, and $\triangle C D X_{1}$ has two sides equal to $C D$, thus $A X_{1}=C D$.
In the same way we have $D X_{1}=A B$
The same argument can be used if we consider the point $X_{2}$. In this case we conclude that $A X_{1}=$ $A X_{2}$ and $D X_{1}=D X_{2}$, then $A D$ and $X_{1} X_{2}$ are perpendicular. But $B C$ and $X_{1} X_{2}$ perpendicular and therefore $A D \| B C$. We are considering the case when $A D$ and $B C$ are diagonals of a cuadrilateral, therefore they are not parallel. This is a contradiction.
If we consider the perpendicular bisector of $B D$, the same argument allows us to conclude that $A C$ and $B D$ are parallel. Therefore a point $X$ on $l$ or $m$ (i.e $(X A B)=(X C D))$ satisfies $(X O B)=(X O D)$ because triangles $O A C$ and $O B D$ are similar. Thus, the points of intersection of $A C$ with $l$ and $B D$ with $l$ are midpoints of the respective segments. Then $X_{1} X_{2} \subset l$ and, since $l$ is the perpendicular bisector and median, triangle $A B D$ is isosceles with $O B=O C$. So, $A B=C D$, which is a contradiction. Therefore $n \leq 4$.

4 POINT for proving that $n \leq 4$.