exam: IZho

problem: Prove that for some positive integer $n$ the remainder of $3^{n}$ when divided by $2^{n}$ is greater than $10^{2021}$.

solution:
We choose a positive integer $M$ such that $2^{M}>10^{2022}$, and consider the remainder of $3^{M}$ when divided by $2^{M}$ :

$$
3^{M} \equiv r \quad\left(\bmod 2^{M}\right), 0<r<2^{M}
$$

If $r>10^{2021}$, then $M$ is the desired number. Otherwise we choose the smallest integer $k$ for which $3^{k} r>$ $>10^{2021}$. Then $3^{k} r<10^{2022}<2^{M}$. Since $3^{k+M} \equiv 3^{k} r\left(\bmod 2^{M}\right)$, the remainder of $3^{k+M}$ when divided by $2^{k+M}$ has the form $3^{k} r+2^{M} s$ with some positive integer $s$, and is therefore greater than $10^{2021}$.

solution_match: Solution I.


solution:
We choose a positive integer $k$ such that $2^{k+2}>10^{2021}$. We are going to determine $v_{2}\left(3^{2^{k}}-1\right)$, i. e. the largest $m$ such that $2^{m}$ divides $3^{2^{k}}-1$. According to well-known lifting the exponent lemma,

$$
v_{2}\left(3^{2^{k}}-1\right)=v_{2}\left(3^{2}-1\right)+k-1=k+2
$$

Then the number $n=2^{k}$ satisfies the condition, Indeed, if $r$ is the remainder when $3^{n}$ is divided by $2^{n}$, then $r \equiv 3^{2^{k}}\left(\bmod 2^{2^{k}}\right)$ and therefore $r \equiv 3^{2^{k}}\left(\bmod 2^{k+3}\right)$ (we use the fact that $\left.2^{k} \geq k+3\right)$. Since $2^{k+2}$ divides $r-1$ and $2^{k+3}$ does not, $r \equiv 1+2^{k+2}\left(\bmod 2^{k+3}\right)$, thus $r \geq 1+2^{k+2}>10^{2021}$.

solution_match: Solution II.


solution:
Choose a positive integer $k$ such that $3^{k}>10^{2021}$, and a positive integer $m$ such that $2^{m}>3^{k}$. There exists a positive integer $T$ such that $3^{T} \equiv 1\left(\bmod 2^{m}\right)$ (we may take, for instance, $T=$ $=2^{m-2}$ ). Then for all positive integral $s$

$$
3^{k+s T} \equiv 3^{k} \quad\left(\bmod 2^{m}\right)
$$

that is, $3^{k+s T}$ leaves the remainder $3^{k}$ after division by $2^{m}$ and, therefore, a remainder not less than $3^{k}>10^{2021}$ after division by any higher power of 2 . Now we can take $n=k+s T$ such that $k+s T>m$.

solution_match: Solution III.


problem: In a convex cyclic hexagon $A B C D E F \quad B C=E F$ and $C D=A F$. Diagonals $A C$ and $B F$ intersect at point $Q$, and diagonals $E C$ and $D F$ intersect at point $P$. Points $R$ and $S$ are marked on the segments $D F$ and $B F$ respectively so that $F R=P D$ and $B Q=F S$. The segments $R Q$ and $P S$ intersect at point $T$. Prove that the line $T C$ bisects the diagonal $D B$.

solution:
It follows obviously that $B F \| C E$ and $A C \| D F$. We denote the circumcircles of $\triangle A B Q$ and $\triangle D E P$ by $\omega_{1}$ and $\omega_{2}$, respectively. Note that the lines $A D$ and $B E$ are internal common tangents to $\omega_{1}$ and $\omega_{2}$. Indeed, $\angle B A Q=\angle B E C=\angle E B Q$, i. e., $E B$ is tangent to $\omega_{1}$; the other tangencies are established similarly. Note that $C P F Q$ is a parallelogram. Then $C Q=F P=R D$, that is, $C Q R D$ is also a parallelogram as well as $C P S B$. The lines $B C$ and $D C$ are not parallel to $B D$. Therefore $R Q$ and $P S$ intersect the line $B D$; we denote the intersections by $X$ and $Y$ respectively. It follows that $X$ lies on $\omega_{1}$, since $\angle Q A B=\angle C D B=\angle B X Q$. Similarly, $Y$ lies on $\omega_{2}$. Thus

$$
D B \cdot D X=D A^{2}=B E^{2}=B D \cdot B Y
$$

hence $D X=B Y$, or $B X=D Y$. Let $T C$ and $B D$ meet at $Z$. Then it follows from $T X \| C D$ and $T Y \| B C$ that

$$
\frac{D Z}{D X}=\frac{C Z}{C T}=\frac{B Z}{B Y}
$$

which immediately gives $D Z=B Z$.

![](https://cdn.mathpix.com/cropped/2024_06_04_78f60b2a7fcc2ea41eedg-02.jpg?height=853&width=583&top_left_y=1047&top_left_x=742)

Note. The equality $B X=D Y$ can be also proved by applying Menelaus theorem to $\triangle B D F$ and the lines $R-Q-X$ and $S-P-Y$.

solution_match: First solution.


solution:
We follow the first solution, using $B F \| C E$ and $A C \| D F$ to note that $C P F Q$, $C Q R D$, and $C P S B$ are parallelograms.

Let $N$ and $M$ be points on the segments $C Q$ and $R N$ respectively such that $F R N Q$ and $F R M S$ are parallelograms. Then $S M=F R=P D$ and $S M \| P D$, that is, $S M D P$ is also a parallelogram, hence $D M=P S=C B$ and $D M \| C B$, therefore $D M B C$ is a parallelogram, and $C M$ bisects $B D$. It remains to prove that $T, M, C$ are collinear.

Applying Menelaus theorem to $\triangle F R Q$ and the line $P-T-S$ (and bearing in mind the parallelograms found above) we have

$$
1=\frac{F P}{P R} \cdot \frac{R T}{T Q} \cdot \frac{Q S}{S F}=\frac{Q C}{C N} \cdot \frac{R T}{T Q} \cdot \frac{N M}{M R}
$$

that is,

$$
\frac{Q C}{C N} \cdot \frac{R T}{T Q} \cdot \frac{N M}{M R}=1
$$

The collinearity $T, M, C$ follows from (1) immediately by converse Menelaus theorem for $\triangle Q N R$.

![](https://cdn.mathpix.com/cropped/2024_06_04_78f60b2a7fcc2ea41eedg-03.jpg?height=560&width=602&top_left_y=131&top_left_x=727)

solution_match: Second solution.


problem:
Let $n \geq 2$ be an integer. Elwyn is given an $n \times n$ table filled with real numbers (each cell of the table contains exactly one number). We define a rook set as a set of $n$ cells of the table situated in $n$ distinct rows as well as in $n$ distinct columns. Assume that, for every rook set, the sum of $n$ numbers in the cells forming the set is nonnegative.

By a move, Elwyn chooses a row, a column, and a real number $a$, and then he adds $a$ to each number in the chosen row, and subtracts $a$ from each number in the chosen column (thus, the number at the intersection of the chosen row and column does not change). Prove that Elwyn can perform a sequence of moves so that all numbers in the table become nonnegative.

Common remarks. We collect here several definitions and easy observations which will be used in the solutions.

A rook set is nonnegative (resp., vanishing) if the sum of the numbers in its cells is nonnegative (resp., zero). An $n \times n$ table filled with real numbers is good (resp., balanced) if every rook set is nonnegative (resp., vanishing).

Notice that the sum of numbers in any rook set does not change during Elwyn's moves, so good (balanced) tables remain such after any sequence of moves. Also, notice that the rows and/or columns of the table can be permuted with no effect on the condition of the problem, as well as on the desired result.

The proofs of the following two easy propositions can be found in the addendum after Solution 2 .

Proposition 1. Assume that $a_{1}, a_{2}, \ldots, a_{n}$ and $b_{1}, b_{2}, \ldots, b_{n}$ are two sequences of real numbers with equal sums. Then Elwyn can perform a sequence of moves resulting in adding $a_{i}$ to all cells in the $i$ th row, and subtracting $b_{j}$ from all numbers in the $j$ th column, for all $i, j=1,2, \ldots, n$.

Proposition 2. If an $n \times n$ table $B$ is balanced, then Elwyn can perform several moves on that table getting a table filled with zeros.

solution:
We start with the following known consequence of Hall's lemma.

Lemma. Let $G=(U \sqcup V, E)$ be a bipartite multigraph with parts $U$ and $V$, both of size $n$. Assume that each vertex has degree $k$; then the edges can be partitioned into $k$ perfect matchings.

Proof. Induction on $k$; the base case $k=1$ is trivial. To perform the step, it suffices to find one perfect matching in the graph: removing the edges of that matching, we obtain a graph with all degrees equal to $k-1$.

The existence of such matching is guaranteed by Hall's lemma. Indeed, let $U^{\prime}$ be any subset of $U$, and let $V^{\prime}$ be the set of vertices adjacent to $U^{\prime}$. Put $u=\left|U^{\prime}\right|$ and $v=\left|V^{\prime}\right|$. The total degree of vertices in $U^{\prime}$ is $k u$. so the total degree of vertices in $V^{\prime}$ is at least $k u$; hence $k u \leq k v$ and therefore $u \leq v$, which establishes the conditions of Hall's lemma.

The following claim is the principal step in this solution.

Claim. In any good table, one can decrease some numbers so that the table becomes balanced.

Proof. Say that a cell in a good table is blocked if it is contained in a vanishing rook set (so, decreasing the number in the cell would break goodness of the table). First, we show that in any good table one can decrease several numbers so that the table remains good, and all its cells become blocked.

Consider any cell $c$; let $\epsilon$ be the minimal sum in a rook set containing that cell. Decrease the number in $c$ by $\epsilon$; the obtained table is still good, but now $c$ is blocked. Apply such operation to all cells in the table consecutively; we arrive at a good table all whose cells are blocked. We claim that, in fact, this table is balanced.

In the sequel, we use the following correspondence. Let $R$ and $C$ be the sets of rows and columns of the table, respectively. Then each cell corresponds to a pair of the row and the column it is situated in; this pair may be regarded as an edge of a bipartite (multi)graph with parts $R$ and $C$. This way, any rook set corresponds to a perfect matching between those parts.

Arguing indirectly, assume that there is a non-vanishing rook set $S=\left\{s_{1}, s_{2}, \ldots, s_{n}\right\}$. Each cell $s_{i}$ is contained in some vanishing rook set $V_{i}$. Now construct a bipartite multigraph $G=(R \sqcup C, E)$, introducing, for each set $V_{i}, n$ edges corresponding to its cells (thus, $G$ contains $n^{2}$ edges some of which may be parallel).

Mark each edge with the number in the corresponding cell. Since the sets $V_{i}$ are all vanishing, the sum of all $n^{2}$ marks is zero.

Now, remove $n$ edges corresponding to the cells of $S$, to obtain a graph $G^{\prime}$. Since the sum of numbers in the cells of $S$ is positive, the sum of the marks in $G^{\prime}$ is negative. On the other hand, the degree of every vertex in $G^{\prime}$ is $n-1$, so by the Lemma its edges can be partitioned into $n-1$ perfect matchings. At least one of the obtained matchings has negative sum of marks; so this matching corresponds to a rook set with a negative sum. This is impossible in a good table; this contradiction finishes the proof.

Back to the problem, let $T$ be Elwyn's table. Applying the Claim, decrease some numbers in it to get a balanced table $B$. By Proposition 2, Elwyn can perform some moves on table $B$ so as to get a table filled with zeros. Applying the same moves to $T$, Elwyn gets a table where all numbers are nonnegative, as required.

solution_match: Solution 1.


solution:
Say that the badness of a table is the sum of absolute values of all its negative entries. In Step 1, we will show that, whenever the badness of a good table is nonzero, Elwyn can make some moves decreasing the badness. In a (technical) Step 2, we will show that this claim yields the required result.

Step 1. Let $r$ be a row containing some negative number. Mark all cells in row $r$ containing negative numbers, and mark all cells in other rows containing nonpositive numbers. Then there is no rook set consisting of marked cells, since that set would not be nonnegative.

By König's theorem (which is equivalent to Hall's lemma), for some $a$ and $b$ with $a+b<n$, one can choose $a$ rows and $b$ columns such that their union contains all marked cells; fix such a choice. Number the rows from top to bottom, and the columns from left to right. We distinguish two cases.

Case 1: Row $r$ is among the a chosen rows.

Permute the rows and columns so that the top $a$ rows and the right $b$ columns are chosen. Next, if row $r$ contains a negative number in some of the $a$ leftmost entries, swap the column containing that entry with the $(n-b)$ th one (recall that $n-b>a$ ). As a result, there exists $x>a$ such that the $x$ th left entry in row $r$ is negative (while the chosen columns are still the $b$ rightmost ones).

Now, rectangle $P$ formed by the bottom $n-a$ rows and the left $a$ columns contains only positive numbers, as it contains no marked cells, as well as no cells from row $r$. Let $m$ be the minimal number in that rectangle.

Let Elwyn add $m$ to all numbers in the first $a$ rows, and subtract $m$ from all numbers in the first $a$ columns. All numbers which decrease after this operation are situated in $P$, so there appear no new cell containing a negative number, and no negative number decreases. Moreover, by our choice, at least one negative number (situated in row $r$ and column $x$ ) increases. Thus, the badness decreases, as desired.

Case 2: Row $r$ is not among the a chosen rows.

Add row $r$ to the $a$ chosen rows, and increase $a$ by 1 . Notice that the negative numbers in row $r$ are covered by the $b$ chosen columns. As in the previous case, we permute the rows and columns so that the top $a$ rows and the tight $b$ columns are chosen. All negative numbers in row $r$ automatically come to the right $b$ columns. Now the above argument applies verbatim.

Step 2. We show that among the tables which Elwyn can obtain (call such tables reachable), there exists a table with the smallest badness. Applying the argument in Step 1 to that table, we get that its badness is zero, which proves the claim of the problem.

Notice that the effect of any sequence of Elwyn's moves has the form described in Proposition 1. Moreover, subtraction of some number $\epsilon$ from all the $a_{i}$ and the $b_{i}$ provides no effect on the result. Hence, we may assume that the sums of the $a_{i}$ and of the $b_{i}$ are both zero.

Let $t_{i j}$ denote the $(i, j)$ th entry of the initial table $T$. For any two sequences $\mathbf{a}=\left(a_{1}, \ldots, a_{n}\right)$ and $\mathbf{b}=\left(b_{1}, \ldots, b_{n}\right)$ both summing up to zero, denote by $T(\mathbf{a}, \mathbf{b})$ the table obtained from $T$ by adding $a_{i}$ to all numbers in the $i$ th row, and subtracting $b_{j}$ from all numbers in the $j$ th column, for all $i, j=1,2, \ldots, n$; in particular, $T=T(\mathbf{0}, \mathbf{0})$, where $\mathbf{0}=(0,0, \ldots, 0)$. Let $f(\mathbf{a}, \mathbf{b})$ denote the badness of $T(\mathbf{a}, \mathbf{b})$. Clearly, function $f$ is continuous. Now we intend to bound the set of values that make sense to put in sequences a and $\mathbf{b}$.

Let $m$ be the maximal number in $T$. Take any $\mathbf{a}$ and $\mathbf{b}$ summing up to zero, such that some $a_{i}$ is smaller than $-M=-(m+b)$. Then there exists an index $j$ with $b_{j} \geq 0$; hence the entry $(i, j)$ in $T(\mathbf{a}, \mathbf{b})$ is $t_{i j}+a_{i}-b_{j}<m-M+0=-b$, so $f(\mathbf{a}, \mathbf{b})>b=f(\mathbf{0}, \mathbf{0})$.

So, all pairs of sequences $\mathbf{a}$ and $\mathbf{b}$ satisfying $f(\mathbf{a}, \mathbf{b}) \leq b$ should also satisfy $a_{i} \geq-M$ and $b_{j} \geq-M$, and hence $a_{i} \leq n M$ and $b_{j} \leq n M$ as well (since each of the sequences sums up to zero). Thus, in order to minimize $f(\mathbf{a}, \mathbf{b})$, it suffices to consider only those $\mathbf{a}$ and $\mathbf{b}$ whose entries lie in $[-M, n M]$. Those values form a compact set, so the continuous function $f$ attains the smallest value on that set.

Addendum. Say that the price of Elwyn's move is the number $a$ chosen on that move.

Proof of Proposition 1. Let Elwyn perform a move of price $a$ to row $i$ and column $j$, and then a move of price $-a$ to row $i^{\prime}$ and the same column $j$. The result will consist in adding $a$ to row $i$ and subtracting $a$ from row $i^{\prime}$. Similar actions can be performed with columns.

So, Elwyn may add $\Sigma=a_{1}+\cdots+a_{n}$ to the numbers in the first row and subtract $\Sigma$ from those in the first column, and then distribute those increments and decrements among the rows and columns, using the above argument.

Proof of Proposition 2. It is easy to see, using Proposition 1, that Elwyn can vanish all numbers in the first column, as well as all numbers in the first row, except for the last its entry.

The resulting table is also balanced; denote the number in its cell $(i, j)$ by $d_{i j}$. For any $i, j>1$ with $j<n$, there are two rook sets $R$ and $R^{\prime}$, one containing cells $(1,1)$ and $(i, j)$, and the other obtained by replacing those by cells $(1, j)$ and $(i, 1)$. The sums in those two sets are both zero, so

$$
d_{i j}=d_{i 1}+d_{1 j}-d_{11}=0
$$

Hence, only the $n$th column of the obtained table might contain nonzero numbers. But, since each entry in the $n$th column is contained in some (vanishing) rook set, that entry is also zero.

Solution 3 (sketch). We implement some tools from multi-dimensional convex geometry.

Each table can be regarded as a point in $\mathbb{R}^{n \times n}$. The set $G$ of good tables is a convex cone determined by $n$ ! non-strict inequalities (claiming that the rook sets are nonnegative). Thus this cone is closed.

The set $T$ of tables which can be transformed, by a sequence of Elwyn's moves, into a table with nonnegative entries, is also a convex cone. This cone is the Minkowski sum of the (closed) cone $N$ of all tables with nonnegative entries and the linear subspace $V$ of all tables Elwyn can add by a sequence of moves. Such sum is always closed (a pedestrian version of such argument is presented in Step 2 of Solution 2).

It is easy to see that $T \subseteq G$; we need to show that $T=G$. Arguing indirectly, assume that there is some table $t \in G \backslash T$. Then there exists a linear function $f$ separating $t$ and $T$, that is $-f$ takes nonnegative values on $T$ but a negative value on $t$.

This function $f$ has the following form: Let $x \in \mathbb{R}^{n \times n}$ be a table, and denote by $x_{i j}$ its $(i, j)$ th entry. Then

$$
f(x)=\sum_{i, j=1}^{n} f_{i j} x_{i j}
$$

where $f_{i j}$ are some real constants. Form a table $F$ whose $(i, j)$ th entry is $f_{i j}$.

Since $f(x) \geq 0$ for all tables in $N$ having only one nonnegative entry, we have $f_{i j} \geq 0$ for all $i$ and $j$. Moreover, $f$ must vanish on all tables in the subspace $V$, in particular - on each table having 1 in some row, -1 in some column, and 0 elsewhere (the intersection of the row and the column also contains 0 ). This means that the sum of numbers in any row in $F$ is equal to the sum of the numbers in any its column.

Now it remains to show that $F$ is the sum of several rook tables which contain some nonnegative number $p$ at the cells of some rook set, while all other entries are zero; this will yield $f(t) \geq 0$ which is not the case. In other words, it suffices to prove that one can subtract from $F$ several rook tables to make it vanish. This can be done by means of Hall's lemma again: if the table is still nonzero, it contains $n$ positive entries forming a rook set, and one may make one of them vanish, keeping the other entries nonnegative, by subtracting a rook table.

solution_match: Solution 2.


problem: A circle with radius $r$ is inscribed in the triangle $A B C$. Circles with radii $r_{1}, r_{2}, r_{3}\left(r_{1}, r_{2}, r_{3}<r\right)$ are inscribed in the angles $A, B, C$ so that each touches the incircle externally. Prove that $r_{1}+r_{2}+r_{3} \geq r$.

solution:
Let $\omega$ be the incircle of $\triangle A B C, I$ its center, and $p=(A B+B C+A C) / 2$ its semiperimeter. We denote the tangency points of the sides $B C, A C, A B$ with $\omega$ by $A_{0}, B_{0}, C_{0}$ respectively. Let the circle of radius $r_{1}$ touches $\omega$ at $A_{1}$.

![](https://cdn.mathpix.com/cropped/2024_06_04_78f60b2a7fcc2ea41eedg-07.jpg?height=554&width=1014&top_left_y=383&top_left_x=521)

We draw a tangent $\ell$ to $\omega$ such that $\ell \| B C$. Let $r_{1}^{\prime}$ be the inradius of the triangle formed by the lines $A B, A C, \ell$. The line $A I$ intersects the circle of radius $r_{1}^{\prime}$ at two points. From these two points let $A_{2}$ be closest to $I$. Then $\frac{r_{1}}{r_{1}^{\prime}}=\frac{A A_{1}}{A A_{2}} \geq 1$ and $\frac{r_{1}^{\prime}}{r}=\frac{A B_{0}}{p}$ (here we use that the semiperimeter of the triangle formed by the lines $A B, A C, \ell$ equals $A B_{0}$ and that this triangle is similar to $\triangle A B C$ ). Applying the same argument to the circles of raidii $r_{2}^{\prime}$ and $r_{3}^{\prime}$ and adding the obtained inequalities, we get

$$
r_{1}+r_{2}+r_{3} \geq r_{1}^{\prime}+r_{2}^{\prime}+r_{3}^{\prime}=r\left(\frac{A B_{0}}{p}+\frac{B C_{0}}{p}+\frac{C B_{0}}{p}\right)=r
$$


solution:
Let $A_{0}, B_{0}, C_{0}, A_{1}, B_{1}, C_{1}$ retain the meaning they had in the first solution. We have $\angle B_{1} I C_{1}=90^{\circ}+\frac{\angle A}{2}, \angle A_{1} I C_{1}=90^{\circ}+\frac{\angle B}{2}, \angle A_{1} I B_{1}=90^{\circ}+\frac{\angle C}{2}$. Obviously

$$
\left(\overrightarrow{I A_{1}}+\overrightarrow{I B_{1}}+\overrightarrow{I C_{1}}\right)^{2} \geq 0
$$

It follows from (1) that

$$
\begin{array}{r}
r^{2}+r^{2}+r^{2}+2 r^{2} \cos \left(90^{\circ}+\frac{\angle A}{2}\right)+2 r^{2} \cos \left(90^{\circ}+\frac{\angle B}{2}\right)+2 r^{2} \cos \left(90^{\circ}+\frac{\angle C}{2}\right) \geq 0 \Leftrightarrow \\
\Leftrightarrow \sin \left(\frac{\angle A}{2}\right)+\sin \left(\frac{\angle B}{2}\right)+\sin \left(\frac{\angle C}{2}\right) \leq \frac{3}{2}
\end{array}
$$

![](https://cdn.mathpix.com/cropped/2024_06_04_78f60b2a7fcc2ea41eedg-07.jpg?height=554&width=1014&top_left_y=2050&top_left_x=521)

Let $I_{1}$ be the centre of the circle of radius $r_{1}$. Draw the perpendicular $I_{1} H$ from $I_{1}$ onto $I B_{0}$. One of the acute angles in the right triangle $I I_{1} H$ is $\frac{\angle A}{2}$, the leg opposite this angle is $r-r_{1}$, and the hypotenuse
is $r+r_{1}$. Therefore $\sin \left(\frac{\angle A}{2}\right)=\frac{r-r_{1}}{r+r_{1}}$. Similarly $\sin \left(\frac{\angle B}{2}\right)=\frac{r-r_{2}}{r+r_{2}}$ and $\sin \left(\frac{\angle C}{2}\right)=\frac{r-r_{3}}{r+r_{3}}$. According to (2)

$$
\frac{r-r_{1}}{r+r_{1}}+\frac{r-r_{2}}{r+r_{2}}+\frac{r-r_{3}}{r+r_{3}} \leq \frac{3}{2} \Leftrightarrow \frac{2 r}{r+r_{1}}+\frac{2 r}{r+r_{2}}+\frac{2 r}{r+r_{3}} \leq \frac{9}{2}
$$

Applying Cauchy-Schwarz inequality we have

$$
\frac{1}{r+r_{1}}+\frac{1}{r+r_{2}}+\frac{1}{r+r_{3}} \geq \frac{9}{r+r_{1}+r+r_{2}+r+r_{3}}
$$

thus, (3) and (4) give $\frac{9}{2} \geq \frac{18 r}{3 r+r_{1}+r_{2}+r_{3}} \Leftrightarrow r_{1}+r_{2}+r_{3} \geq r$.


problem:
On a party with 99 guests, hosts Ann and Bob play a game (the hosts are not regarded as guests). There are 99 chairs arranged in a circle; initially, all guests hang around those chairs. The hosts take turns alternately. By a turn, a host orders any standing guest to sit on an unoccupied chair $c$. If some chair adjacent to $c$ is already occupied, the same host orders one guest on such chair to stand up (if both chairs adjacent to $c$ are occupied, the host chooses exactly one of them). All orders are carried out immediately. Ann makes the first move; her goal is to fulfill, after some move of hers, that at least $k$ chairs are occupied. Determine the largest $k$ for which Ann can reach the goal, regardless of Bob's play.

Answer. $k=34$.

solution:
Preliminary notes. Let $F$ denote the number of occupied chairs at the current position in the game. Notice that, on any turn, $F$ does not decrease. Thus, we need to determine the maximal value of $F$ Ann can guarantee after an arbitrary move (either hers or her opponent's).

Say that the situation in the game is stable if every unoccupied chair is adjacent to an occupied one. In a stable situation, we have $F \geq 33$, since at most $3 F$ chairs are either occupied or adjacent to such. Moreover, the same argument shows that there is a unique (up to rotation) stable situation with $F=33$, in which exactly every third chair is occupied; call such stable situation bad.

If the situation after Bob's move is stable, then Bob can act so as to preserve the current value of $F$ indefinitely. Namely, if $A$ puts some guest on chair $a$, she must free some chair $b$ adjacent to $a$. Then Bob merely puts a guest on $b$ and frees $a$, returning to the same stable position.

On the other hand, if the situation after Bob's move is unstable, then Ann may increase $F$ in her turn by putting a guest on a chair having no adjacent occupied chairs.

Strategy for Ann, if $k \leq 34$. In short, Ann's strategy is to increase $F$ avoiding appearance of a bad situation after Bob's move (conversely, Ann creates a bad situation in her turn, if she can).

So, on each her turn, Ann takes an arbitrary turn increasing $F$ if there is no danger that Bob reaches a bad situation in the next turn (thus, Ann always avoids forcing any guest to stand up). The exceptional cases are listed below.

Case 1. After possible Ann's move (consisting in putting a guest on chair $a$ ), we have $F=32$, and Bob can reach a bad situation by putting a guest on some chair. This means that, after Ann's move, every third chair would be occupied, with one exception. But this means that, by her move, Ann could put a guest on a chair adjacent to $a$, avoiding the danger.

Case 2. After possible Ann's move (by putting a guest on chair $a$ ), we have $F=33$, and Bob can reach a stable situation by putting a guest on some chair $b$ and freeing an adjacent chair $c$. If $a=c$, then Ann could put her guest on $b$ to create a stable situation after her turn; that enforces Bob to break stability in his turn. Otherwise, as in the previous case, Ann could put a guest on some chair adjacent to $a$, still increasing the value of $F$, but with no danger of bad situation arising.

So, acting as described, Ann increases the value of $F$ on each turn of hers whenever $F \leq 33$. Thus, she reaches $F=34$ after some her turn.

Strategy for Bob, if $k \geq 35$. Split all chairs into 33 groups each consisting of three consecutive chairs, and number the groups by $1,2, \ldots, 33$ so that Ann's first turn uses a chair from group 1. In short, Bob's strategy is to ensure, after each his turn, that

$(*)$ In group 1, at most two chairs are occupied; in every other group, only the central chair may be occupied.

If $(*)$ is satisfied after Bob's turn, then $F \leq 34<k$; thus, property $(*)$ ensures that Bob will not lose. It remains to show that Bob can always preserve $(*)$. after any his turn. Clearly, he can do that oat the first turn.

Suppose first that Ann, in her turn, puts a guest on chair $a$ and frees an adjacent chair $b$, then Bob may revert her turn by putting a guest on chair $b$ and freeing chair $a$.

Suppose now that Ann just puts a guest on some chair $a$, and the chairs adjacent to $a$ are unoccupied. In particular, group 1 still contains at most two occupied chairs. If the obtained situation satisfies (*), then Bob just makes a turn by putting a guest into group 1 (preferably, on its central chair), and, possibly, removing another guest from that group. Otherwise, $a$ is a non-central chair in some group $i \geq 2$; in this case Bob puts a guest to the central chair in group $i$ and frees chair $a$.

So Bob indeed can always preserve (*).

solution_match: Solution.


problem:
Let $P(x)$ be a nonconstant polynomial of degree $n$ with rational coefficients which can not be presented as a product of two nonconstant polynomials with rational coefficients. Prove that the number of polynomials $Q(x)$ of degree less than $n$ with rational coefficients such that $P(x)$ divides $P(Q(x))$

a) is finite;

b) does not exceed $n$.

solution:
It is known that an irreducible polynomial $P(x)$ of degree $n$ with rational coefficients has $n$ different complex roots which we denote by $\alpha_{1}, \alpha_{2}, \ldots, \alpha_{n}$.

a) If $P(x)$ divides $P(Q(x))$, then $Q\left(\alpha_{k}\right)$ is also a root of $P(x)$ for each $k \leq n$. It follows that the values of $Q$ at $\alpha_{1}, \alpha_{2}, \ldots, \alpha_{n}$ form a sequence $\alpha_{i_{1}}, \alpha_{i_{2}}, \ldots, \alpha_{i_{n}}$, where all terms are roots of $P$, not necessarily different. The number of such sequences is $n^{n}$, and for each sequence there exists at most one polynomial $Q$ such that $Q\left(\alpha_{k}\right)=\alpha_{i_{k}}$ (since two polynomials of degree less than $n$ with equal values at $n$ points must coincide).

Thus the number of possible polynomials $Q(x)$ does not exceed $n^{n}$.

b) For each polynomial $Q$ satisfying the condition, $Q\left(\alpha_{1}\right)$ equals one of the roots $\alpha_{i}$. However, there is at most one polynomial $Q$ of degree less than $n$ with rational coefficients such that $Q\left(\alpha_{1}\right)=\alpha_{i}$, Indeed, if $Q_{1}\left(\alpha_{1}\right)=Q_{2}\left(\alpha_{1}\right)=\alpha_{i}$, then $\alpha_{1}$ is a root of the polynomial $Q_{1}-Q_{2}$ with rational coefficients and degree less than $n$. If this polynomial is not identically zero, its greatest common divisor with $P$ is a nonconstant divisor of $P$ with rational coefficients and degree less than $n$, a contradiction.

Thus the number of possible polynomials $Q(x)$ does not exceed $n$.