exam: EGMO

problem:
The side $B C$ of the triangle $A B C$ is extended beyond $C$ to $D$ so that $C D=B C$. The side $C A$ is extended beyond $A$ to $E$ so that $A E=2 C A$.

Prove that if $A D=B E$, then the triangle $A B C$ is right-angled.

solution:
Define $F$ so that $A B F D$ is a parallelogram. Then $E, A, C, F$ are collinear (as diagonals of a parallelogram bisect each other) and $B F=A D=B E$. Further, $A$ is the midpoint of $E F$, since $A F=2 A C$, and thus $A B$ is an altitude of the isosceles triangle $E B F$ with apex $B$. Therefore $A B \perp A C$.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-02.jpg?height=484&width=819&top_left_y=929&top_left_x=607)

A Variant. Let $P$ be the midpoint of $[A E]$, so that $A P=A B$ because $A E=2 A B$. Let $Q$ be the midpoint of $[A B]$. Then $P Q=\frac{1}{2} B E=\frac{1}{2} A D=C Q$. Hence $P A$ is a median of the isosceles triangle $C P Q$. In other words, $P A \perp A B$, which completes the proof.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-02.jpg?height=408&width=808&top_left_y=1688&top_left_x=626)

problem_match: Problem 1. (Proposed by David Monk, United Kingdom)

solution_match: Solution 1:


solution:
Notice that $A$ is the centroid of triangle $B D E$, since $C$ is the midpoint of $[B D]$ and $A E=2 C A$. Let $M$ be the midpoint of $[B E]$. Then $M, A, D$ lie on a line, and further, $A M=\frac{1}{2} A D=\frac{1}{2} B E$. This implies that $\angle E A B=90^{\circ}$.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-03.jpg?height=399&width=806&top_left_y=332&top_left_x=627)

solution_match: Solution 2:


solution:
Let $P$ be the midpoint $[A E]$. Since $C$ is the midpoint of $[B D]$, and, moreover, $A C=E P$, we have

$$
[A C D]=[A B C]=[E B P]
$$

But $A D=B E$, and, as mentioned previously, $A C=E P$, so this implies that

$$
\angle B E P=\angle C A D \text { or } \angle B E P=180^{\circ}-\angle C A D .
$$

But $\angle B E P<\angle B A C$ and $\angle B A C+\angle C A D=\angle B A D<180^{\circ}$, so we must be in the first case, i.e. $\angle B E P=\angle C A D$. It follows that triangles $B E P$ and $D A C$ are congruent, and thus $\angle B P A=\angle A C B$. But $A P=A C$, so $B A$ is a median of the isosceles triangle $B C P$. Thus $A B \perp P C$, completing the proof.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-03.jpg?height=397&width=806&top_left_y=1493&top_left_x=627)

solution_match: Solution 3:


solution:
Write $\beta=\angle E C B$, and let $x=A C, y=B C=C D, z=B E=A D$. Notice that $E C=3 x$. Then, using the cosine theorem,

$$
\begin{array}{ll}
z^{2}=x^{2}+y^{2}+2 x y \cos \beta & \text { in triangle } A C D ; \\
z^{2}=9 x^{2}+y^{2}-6 x y \cos \beta & \text { in triangle } B C E .
\end{array}
$$

Hence $4 z^{2}=12 x^{2}+4 y^{2}$ or $z^{2}-y^{2}=3 x^{2}$. Let $H$ be the foot of the perpendicular through $B$ to $A C$, and write $h=B H$. Then

$$
y^{2}-h^{2}=C H^{2}, z^{2}-h^{2}=E H^{2}
$$

Hence $z^{2}-y^{2}=E H^{2}-C H^{2}$. Substituting from the above,

$$
E H^{2}-C H^{2}=3 x^{2}=E A^{2}-C A^{2} .
$$

Thus $H=A$, and hence the triangle $A B C$ is right-angled at $A$.
Remark. It is possible to conclude directly from $z^{2}-y^{2}=3 x^{2}=(2 x)^{2}-x^{2}$ using Carnot's theorem.

solution_match: Solution 4:


solution:
Writing $a=B C, b=C A, c=A B$, we have

$$
\left.\begin{array}{rlrl}
a^{2} & =b^{2}+c^{2}-2 b c \cos \angle A \\
c^{2} & =a^{2}+b^{2}-2 a b \cos \angle C
\end{array}\right\} \quad \begin{array}{ll}
\text { in triangle } A B C ; \\
E B^{2} & =4 b^{2}+c^{2}+4 b c \cos \angle A \\
A D^{2} & =a^{2}+b^{2}+2 a b \cos \angle C
\end{array} \quad \begin{aligned}
& \text { in triangle } A E B ; \\
& \text { in triangle } A C D .
\end{aligned}
$$

Thus

$$
\begin{aligned}
6 b^{2}+3 c^{2}-2 a^{2} & =4 b^{2}+c^{2}+4 b c \cos \angle A=E B^{2}=A D^{2} \\
& =a^{2}+b^{2}+2 a b \cos \angle C=2 a^{2}+2 b^{2}-c^{2}
\end{aligned}
$$

which gives $a^{2}=b^{2}+c^{2}$. Therefore $\angle B A C$ is a right angle by the converse of the theorem of Pythagoras.

solution_match: Solution 5:


solution:
Let $\overrightarrow{A C}=\vec{x}$ and $\overrightarrow{A B}=\vec{y}$. Now $\overrightarrow{A D}=2 \vec{x}-\vec{y}$ and $\overrightarrow{E B}=2 \vec{x}+\vec{y}$. Then

$$
\overrightarrow{B E} \cdot \overrightarrow{B E}=\overrightarrow{A D} \cdot \overrightarrow{A D} \quad \Longleftrightarrow \quad(2 \vec{x}+\vec{y})^{2}=(2 \vec{x}-\vec{y})^{2} \quad \Longleftrightarrow \quad \vec{x} \cdot \vec{y}=0
$$

and thus $A C \perp A B$, whence triangle $A B C$ is right-angled at $A$.
Remark. It is perhaps more natural to introduce $\overrightarrow{C A}=\vec{a}$ and $\overrightarrow{C B}=\vec{b}$. Then we have the equality

$$
(3 \vec{a}-\vec{b})^{2}=(\vec{a}+\vec{b})^{2} \quad \Longrightarrow \quad \vec{a} \cdot(\vec{a}-\vec{b})=0
$$

solution_match: Solution 6:


solution:
Let $a, b, c, d, e$ denote the complex co-ordinates of the points $A, B, C, D$, $E$ and take the unit circle to be the circumcircle of $A B C$. We have

$$
d=b+2(c-b)=2 c-b \quad \text { and } \quad e=c+3(a-c)=3 a-2 c .
$$

Thus $b-e=(d-a)+2(b-a)$, and hence

$$
\begin{aligned}
B E=A D & \Longleftrightarrow(b-e)(\overline{b-e})=(d-a)(\overline{d-a}) \\
& \Longleftrightarrow 2(d-a)(\overline{b-a})+2(\overline{d-a})(b-a)+4(b-a)(\overline{b-a})=0 \\
& \Longleftrightarrow 2(d-a)(a-b)+2(\overline{d-a})(b-a) a b+4(b-a)(a-b)=0 \\
& \Longleftrightarrow(d-a)-(\overline{d-a}) a b+2(b-a)=0 \\
& \Longleftrightarrow 2 c-b-a-2 \bar{c} a b+a+b+2(b-a)=0 \\
& \Longleftrightarrow c^{2}-a b+b c-a c=0 \\
& \Longleftrightarrow(b+c)(c-a)=0,
\end{aligned}
$$

implying $c=-b$ and that triangle $A B C$ is right-angled at $A$.

solution_match: Solution 7:


solution:
We use areal co-ordinates with reference to the triangle $A B C$. Recall that if $\left(x_{1}, y_{1}, z_{1}\right)$ and $\left(x_{2}, y_{2}, z_{2}\right)$ are points in the plane, then the square of the distance between these two points is $-a^{2} v w-b^{2} w u-c^{2} u v$, where $(u, v, w)=\left(x_{1}-x_{2}, y_{1}-y_{2}, z_{1}-z_{2}\right)$.
In our case $A=(1,0,0), B=(0,1,0), C=(0,0,1)$, so $E=(3,0,2)$ and, introducing point $F$ as in the first solution, $F=(-1,0,2)$. Then

$$
B E^{2}=A D^{2} \quad \Longleftrightarrow \quad-2 a^{2}+6 b^{2}+3 c^{2}=2 a^{2}+2 b^{2}-c^{2},
$$

and thus $a^{2}=b^{2}+c^{2}$. Therefore $\angle B A C$ is a right angle by the converse of the theorem of Pythagoras.

solution_match: Solution 8:


problem: Determine all integers $m$ for which the $m \times m$ square can be dissected into five rectangles, the side lengths of which are the integers $1,2,3, \ldots, 10$ in some order.

solution:
The solution naturally divides into three different parts: we first obtain some bounds on $m$. We then describe the structure of possible dissections, and finally, we deal with the few remaining cases.

In the first part of the solution, we get rid of the cases with $m \leqslant 10$ or $m \geqslant 14$. Let $\ell_{1}, \ldots, \ell_{5}$ and $w_{1}, \ldots, w_{5}$ be the lengths and widths of the five rectangles. Then the rearrangement inequality yields the lower bound

$$
\begin{aligned}
\ell_{1} w_{1} & +\ell_{2} w_{2}+\ell_{3} w_{3}+\ell_{4} w_{4}+\ell_{5} w_{5} \\
& =\frac{1}{2}\left(\ell_{1} w_{1}+\ell_{2} w_{2}+\ell_{3} w_{3}+\ell_{4} w_{4}+\ell_{5} w_{5}+w_{1} \ell_{1}+w_{2} \ell_{2}+w_{3} \ell_{3}+w_{3} \ell_{4}+w_{5} \ell_{5}\right) \\
& \geqslant \frac{1}{2}(1 \cdot 10+2 \cdot 9+3 \cdot 8+\cdots+8 \cdot 3+9 \cdot 2+10 \cdot 1)=110
\end{aligned}
$$

and the upper bound

$$
\begin{aligned}
\ell_{1} w_{1} & +\ell_{2} w_{2}+\ell_{3} w_{3}+\ell_{4} w_{4}+\ell_{5} w_{5} \\
& =\frac{1}{2}\left(\ell_{1} w_{1}+\ell_{2} w_{2}+\ell_{3} w_{3}+\ell_{4} w_{4}+\ell_{5} w_{5}+w_{1} \ell_{1}+w_{2} \ell_{2}+w_{3} \ell_{3}+w_{3} \ell_{4}+w_{5} \ell_{5}\right) \\
& \leqslant \frac{1}{2}(1 \cdot 1+2 \cdot 2+3 \cdot 3+\cdots+8 \cdot 8+9 \cdot 9+10 \cdot 10)=192.5
\end{aligned}
$$

As the area of the square is sandwiched between 110 and 192.5, the only possible candidates for $m$ are 11,12 , and 13 .

In the second part of the solution, we show that a dissection of the square into five rectangles must consist of a single inner rectangle and four outer rectangles that each cover one of the four corners of the square. Indeed, if one of the sides the square had three rectangles adjacent to it, removing these three rectangles would leave a polygon with eight vertices, which is clearly not the union of two rectangles. Moreover, since $m>10$, each side of the square has at least two adjacent rectangles. Hence each side of the square has precisely two adjacent rectangles, and thus the only way of partitionning the square into five rectangles is to have a single inner rectangle and four outer rectangles each covering of the four corners of the square, as claimed.

Let us now show that a square of size $12 \times 12$ cannot be dissected in the desired way. Let $R_{1}, R_{2}, R_{3}$ and $R_{4}$ be the outer rectangles (in clockwise orientation along the
boundary of the square). If an outer rectangle has a side of length $s$, then some adjacent outer rectangle must have a side of length $12-s$. Therefore, neither of $s=1$ or $s=6$ can be sidelengths of an outer rectangle, so the inner rectangle must have dimensions $1 \times 6$. One of the outer rectangles (say $R_{1}$ ) must have dimensions $10 \times x$, and an adjacent rectangle (say $R_{2}$ ) must thus have dimensions $2 \times y$. Rectangle $R_{3}$ then has dimensions $(12-y) \times z$, and rectangle $R_{4}$ has dimensions $(12-z) \times(12-x)$. Note that exactly one of the three numbers $x, y, z$ is even (and equals 4 or 8 ), while the other two numbers are odd. Now, the total area of all five rectangles is

$$
144=6+10 x+2 y+(12-y) z+(12-z)(12-x),
$$

which simplifies to $(y-x)(z-2)=6$. As exactly one of the three numbers $x, y, z$ is even, the factors $y-x$ and $z-2$ are either both even or both odd, so their product cannot equal 6 , and thus there is no solution with $m=12$.

Finally, we handle the cases $m=11$ and $m=13$, which indeed are solutions. The corresponding rectangle sets are $10 \times 5,1 \times 9,8 \times 2,7 \times 4$ and $3 \times 6$ for $m=11$, and $10 \times 5,9 \times 8,4 \times 6,3 \times 7$ and $1 \times 2$ for $m=13$. These sets can be found by trial and error. The corresponding partitions are shown in the figure below.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-07.jpg?height=692&width=1398&top_left_y=1280&top_left_x=292)

Remark. The configurations for $m=11$ and $m=13$ given above are not unique.
A Variant for Obtaining Bounds. We first exclude the cases $m \leqslant 9$ by the observation that one of the small rectangles has a side of length 10 and must fit into the square; hence $m \geqslant 10$.

To exclude the cases $m \geqslant 14$, we work via the perimeter: as every rectangle has at most two sides on the boundary of the $m \times m$ square, the perimeter $4 m$ of the square is bounded by $1+2+3+4+5+6+7+8+9+10=55$; hence $m \leqslant 13$.

We are left to deal with the case $m=10$ : clearly, the rectangle with side length 10 must have one its sides of length 10 along the boundary of the square. The remaining rectangle $R$ of dimensions $10 \times s$, say, would have to be divided into four rectangles with different sidelengths strictly less than 10 . If there were at least two rectangles adjacent to one of the sides of length $s$ of $R$, removing these two rectangles from $R$ would leave a polygon with at least six vertices (since the sidelengths of the rectangles partitioning $R$ are strictly less than 10). It is clearly impossible to partition such a polygon into no more than two rectangles with different sidelengths. Hence, given a side of length $s$ of $R$, there is only one rectangle adjacent to that side, so the rectangles adjacent to the sides of length $s$ of $R$ would have to have the same length $s$, a contradiction.

Remark. Note that the argument of the second part of the main solution cannot be directly applied to the case $m=10$.

A Variant for Dealing with $\boldsymbol{m}=12$. As in the previous solution, we show that the inner rectangle must have dimensions $1 \times 6$. Since the area of the square and the area of the inner rectangle are even, the areas of the four outer rectangles must sum to an even number. Now the four sides of the square are divided into segments of lengths 2 and 10, 3 and 9,4 and 8 , and 5 and 7 . Hence the sides with adjacent segments of lengths 3 and 9 , and 5 and 7 must be opposite sides of the square (otherwise, exactly one of the outer rectangles would have odd area). However, the difference of two rectangle side lengths on opposite sides of the square must be 1 or 6 (in order to accomodate the inner rectangle). This is not the case, so there is no solution with $m=12$.

Remark. In the case $m=12$, having shown that the inner rectangle must have dimensions $1 \times 6$, this case can also be dealt with by listing the remaining configurations one by one.

problem_match: Problem 2. (Proposed by Matti Lehtinen, Finland)

solution_match: Solution:


problem:
Let $\boldsymbol{n}$ be a positive integer.

(a) Prove that there exists a set $S$ of $6 n$ pairwise different positive integers, such that the least common multiple of any two elements of $S$ is no larger than $32 n^{2}$.
(b) Prove that every set $T$ of $6 n$ pairwise different positive integers contains two elements the least common multiple of which is larger than $9 \boldsymbol{n}^{2}$.

solution:
(a) Let the set $A$ consist of the $4 n$ integers $1,2, \ldots, 4 n$ and let the set $B$ consist of the $2 n$ even integers $4 n+2,4 n+4, \ldots, 8 n$. We claim that the $6 n$-element set $S=A \cup B$ has the desired property.

Indeed, the least common multiple of two (even) elements of $B$ is no larger than $8 n \cdot(8 n / 2)=32 n^{2}$, and the least common multiple of some element of $A$ and some element of $A \cup B$ is at most their product, which is at most $4 n \cdot 8 n=32 n^{2}$.
(b) We prove the following lemma: "If a set $U$ contains $m+1$ integers, where $m \geqslant 2$, that are all not less than $m$, then some two of its elements have least common multiple strictly larger than $m^{2}$."

Let the elements of $U$ be $u_{1}>u_{2}>\cdots>u_{m+1} \geqslant m$. Note that $1 / u_{1} \leqslant 1 / u_{i} \leqslant 1 / m$ for $1 \leqslant i \leqslant m+1$. We partition the interval $\left[1 / u_{1} ; 1 / m\right]$ into $m$ subintervals of equal length. By the pigeonhole principle, there exist indices $i, j$ with $1 \leqslant i<j \leqslant m+1$ such that $1 / u_{i}$ and $1 / u_{j}$ belong to the same subinterval. Hence

$$
0<\frac{1}{u_{j}}-\frac{1}{u_{i}} \leqslant \frac{1}{m}\left(\frac{1}{m}-\frac{1}{u_{1}}\right)<\frac{1}{m^{2}} .
$$

Now $1 / u_{j}-1 / u_{i}$ is a positive fraction with denominator $\operatorname{lcm}\left(u_{i}, u_{j}\right)$. The above thus yields the lower bound $\operatorname{lcm}\left(u_{i}, u_{j}\right)>m^{2}$, completing the proof of the lemma.

Applying the lemma with $m=3 n$ to the $3 n+1$ largest elements of $T$, which are all not less than $3 n$, we arrive at the desired statement.

A Variant. Alternatively, for part (b), we prove the following lemma: "If a set $U$ contains $m \geqslant 2$ integers that all are greater than $m$, then some two of its elements have least common multiple strictly larger than $m^{2}$."

Let $u_{1}>u_{2}>\cdots>u_{m}$ be the elements of $U$. Since $u_{m}>m=m^{2} / m$, there exists a smallest index $k$ such that $u_{k}>m^{2} / k$. If $k=1$, then $u_{1}>m^{2}$, and the least common multiple of $u_{1}$ and $u_{2}$ is strictly larger than $m^{2}$. So let us suppose $k>1$ from now on, so that we have $u_{k}>m^{2} / k$ and $u_{k-1} \leqslant m^{2} /(k-1)$. The greatest common divisor $d$ of $u_{k-1}$ and $u_{k}$ satisfies

$$
d \leqslant u_{k-1}-u_{k}<\frac{m^{2}}{k-1}-\frac{m^{2}}{k}=\frac{m^{2}}{(k-1) k}
$$

This implies $m^{2} /(d k)>k-1$ and $u_{k} / d>k-1$, and hence $u_{k} / d \geqslant k$. But then the least common multiple of $u_{k-1}$ and $u_{k}$ equals

$$
\frac{u_{k-1} u_{k}}{d} \geqslant u_{k} \cdot \frac{u_{k}}{d}>\frac{m^{2}}{k} \cdot k=m^{2}
$$

and the proof of the lemma is complete.
If we remove the $3 n$ smallest elements from set $T$ and apply the lemma with $m=3 n$ to the remaining elements, we arrive at the desired statement.

problem_match: Problem 3. (Proposed by Dan Schwarz, Romania)


problem:
Find all positive integers $a$ and $b$ for which there are three consecutive integers at which the polynomial

$$
P(n)=\frac{n^{5}+a}{b}
$$

## takes integer values.

solution:
Denote the three consecutive integers by $x-1, x$, and $x+1$, so that

$$
(x-1)^{5}+a \equiv 0 \quad(\bmod b), \quad x^{5}+a \equiv 0 \quad(\bmod b), \quad(x+1)^{5}+a \equiv 0 \quad(\bmod b) .
$$

By computing the differences of the equations in (1) we get

$$
\begin{aligned}
A & :=(x+1)^{5}-(x-1)^{5}=10 x^{4}+20 x^{2}+2 \equiv 0 \quad(\bmod b) \\
B & :=(x+1)^{5}-x^{5}=5 x^{4}+10 x^{3}+10 x^{2}+5 x+1 \equiv 0 \quad(\bmod b)
\end{aligned}
$$

Adding the first and third equation in (1) and subtracting twice the second equation yields

$$
C:=(x+1)^{5}+(x-1)^{5}-2 x^{5}=20 x^{3}+10 x \equiv 0 \quad(\bmod b) .
$$

Next, (2) and (4) together yield

$$
D:=4 x A-\left(2 x^{2}+3\right) C=-22 x \equiv 0(\bmod b) .
$$

Finally we combine (3) and (5) to derive

$$
22 B+\left(5 x^{3}+10 x^{2}+10 x+5\right) D=22 \equiv 0(\bmod b) .
$$

As the positive integer $b$ divides 22 , we are left with the four cases $b=1, b=2, b=11$ and $b=22$.

If $b$ is even (i.e. $b=2$ or $b=22$ ), then we get a contradiction from (3), because the integer $B=2\left(5 x^{3}+5 x^{2}\right)+5\left(x^{4}+x\right)+1$ is odd, and hence not divisible by any even integer.

For $b=1$, it is trivial to see that a polynomial of the form $P(n)=n^{5}+a$, with $a$ any positive integer, has the desired property.

For $b=11$, we note that

$$
\begin{aligned}
& n \equiv 0,1,2,3,4,5,6,7,8,9,10 \quad(\bmod 11) \\
& \Longrightarrow \quad n^{5} \equiv 0,1,-1,1,1,1,-1,-1,-1,1,-1 \quad(\bmod 11)
\end{aligned}
$$

Hence a polynomial of the form $P(n)=\left(n^{5}+a\right) / 11$ has the desired property if and only if $a \equiv \pm 1(\bmod 11)$. This completes the proof.

A Variant. We start by following the first solution up to equation (4). We note that $b=1$ is a trivial solution, and assume from now on that $b \geqslant 2$. As $(x-1)^{5}+a$ and $x^{5}+a$ have different parity, $b$ must be odd. As $B$ in (3) is a multiple of $b$, we conclude that (i) $b$ is not divisible by 5 and that (ii) $b$ and $x$ are relatively prime. As $C=10 x\left(2 x^{2}+1\right)$ in (4) is divisible by $b$, we altogether derive

$$
E:=2 x^{2}+1 \equiv 0(\bmod b)
$$

Together with (2) this implies that

$$
5 E^{2}+10 E-2 A=11 \equiv 0 \quad(\bmod b)
$$

Hence $b=11$ is the only remaining candidate, and it is handled as in the first solution.

problem_match: Problem 4. (Proposed by Vesna Iršič, Slovenia)


solution:
Let $p$ be a prime such that $p$ divides $b$. For some integer $x$, we have

$$
(x-1)^{5} \equiv x^{5} \equiv(x+1)^{5} \quad(\bmod p)
$$

Now, there is a primitive root $g$ modulo $p$, so there exist $u, v, w$ such that

$$
x-1 \equiv g^{u} \quad(\bmod p), \quad x \equiv g^{v} \quad(\bmod p), \quad x+1 \equiv g^{w} \quad(\bmod p)
$$

The condition of the problem is thus

$$
g^{5 u} \equiv g^{5 v} \equiv g^{5 w} \quad(\bmod p) \quad \Longrightarrow \quad 5 u \equiv 5 v \equiv 5 w \quad(\bmod p-1)
$$

If $p \not \equiv 1(\bmod 5)$, then 5 is invertible modulo $p-1$ and thus $u \equiv v \equiv w(\bmod p-1)$, i.e. $x-1 \equiv x \equiv x+1(\bmod p)$. This is a contradiction. Hence $p \equiv 1(\bmod 5)$ and thus $u \equiv v \equiv w\left(\bmod \frac{p-1}{5}\right)$. Thus, from (6), there exist integers $k, \ell$ such that

$$
\left.\begin{array}{rl}
x-1 & \equiv g^{v+k \frac{p-1}{5}} \equiv x t^{k} \quad(\bmod p) \\
x+1 & \equiv g^{v+\ell \frac{p-1}{5}} \\
\equiv x t^{\ell} & (\bmod p)
\end{array}\right\} \quad \text { where } t=g^{\frac{p-1}{5}}
$$

Let $r=t^{k}$ and $s=t^{\ell}$. In particular, the above yields $r, s \not \equiv 1(\bmod p)$, and thus

$$
x \equiv-(r-1)^{-1} \equiv(s-1)^{-1} \quad(\bmod p)
$$

It follows that

$$
(r-1)^{-1}+(s-1)^{-1} \equiv 0 \quad(\bmod p) \quad \Longrightarrow \quad r+s \equiv 2 \quad(\bmod p)
$$

Now $t^{5} \equiv 1(\bmod p)$, so $r$ and $s$ must be congruent, modulo $p$, to some of the non-trivial fifth roots of unity $t, t^{2}, t^{3}, t^{4}$. Observe that, for any pair of these non-trivial roots of unity,
either one is the other's inverse, or one is the other's square. In the first case, we have $r+r^{-1} \equiv 2(\bmod p)$, implying $r \equiv 1(\bmod p)$, a contradiction. Hence

$$
r+r^{2} \equiv 2 \quad(\bmod p) \quad \Longrightarrow \quad(r-1)(r+2) \equiv 0 \quad(\bmod p),
$$

or

$$
s^{2}+s \equiv 2 \quad(\bmod p) \quad \Longrightarrow \quad(s-1)(s+2) \equiv 0 \quad(\bmod p)
$$

Thus, since $r, s \not \equiv 1(\bmod p)$, we have $r \equiv-2(\bmod p)$ or $s \equiv-2(\bmod p)$, and thus $1 \equiv r^{5} \equiv-32(\bmod p)$ or an analogous equation obtained from $s$. Hence $p \mid 33$. Since $p \equiv 1(\bmod 5)$, it follows that $p=11$, i.e. $b$ is a power of 11 .

Examining the fifth powers modulo 11 , we see that $b=11$ is indeed a solution with $a \equiv \pm 1(\bmod 11)$ and, correspondingly, $x \equiv \pm 4(\bmod 11)$. Now suppose, for the sake of contradiction, that $11^{2}$ divides $b$. Then, for some integer $m$, we must have

$$
(x-1, x, x+1) \equiv \pm(3+11 m, 4+11 m, 5+11 m) \quad(\bmod 121)
$$

and thus, substituting into the condition of the problem,

$$
\begin{aligned}
3^{5}+55 \cdot 3^{4} m & \equiv 4^{5}+55 \cdot 4^{4} m \equiv 5^{5}+55 \cdot 5^{4} m \quad(\bmod 121) \\
& \Longrightarrow \quad 1-22 m \equiv 56+44 m \equiv-21+11 m \quad(\bmod 121)
\end{aligned}
$$

Hence $33 m \equiv 22(\bmod 121)$ and $33 m \equiv 44(\bmod 121)$, so $22 \equiv 0(\bmod 121)$, a contradiction. It follows that $b \mid 11$.

Finally, we conclude that the positive integers satisfying the original condition are $b=11$, with $a \equiv \pm 1(\bmod 11)$, and $b=1$, for any positive integer $a$.


solution:
Denote the three consecutive integers by $x-1, x$, and $x+1$ as in Solution 1. By computing the differences in (1), we find

$$
\begin{aligned}
& F:=(x+1)^{5}-x^{5}=5 x^{4}+10 x^{3}+10 x^{2}+5 x+1 \equiv 0 \quad(\bmod b), \\
& G:=x^{5}-(x-1)^{5}=5 x^{4}-10 x^{3}+10 x^{2}-5 x+1 \equiv 0 \quad(\bmod b) .
\end{aligned}
$$

By determining the polynomial greatest divisor of $F(x)$ and $G(x)$ using the Euclidean algorithm, we find that

$$
p(x) F(x)+q(x) G(x)=22
$$

where

$$
\begin{aligned}
& p(x)=-15 x^{3}+30 x^{2}-28 x+11 \\
& q(x)=15 x^{3}+30 x^{2}+28 x+11
\end{aligned}
$$

Since $b \mid F(x)$ and $b \mid G(x)$, it follows from (7) that $b \mid 22$. We now finish off the problem as in Solution 1.


problem:
Let $\Omega$ be the circumcircle of the triangle $A B C$. The circle $\omega$ is tangent to the sides $A C$ and $B C$, and it is internally tangent to $\Omega$ at the point $P$. A line parallel to $A B$ and intersecting the interior of triangle $A B C$ is tangent to $\omega$ at $Q$.

Prove that $\angle A C P=\angle Q C B$.

solution:
Assume that $\omega$ is tangent to $A C$ and $B C$ at $E$ and $F$, respectively and let $P E, P F, P Q$ meet $\Omega$ at $K, L, M$, respectively. Let $I$ and $O$ denote the respective centres of $\omega$ and $\Omega$, and consider the homethety $\mathscr{H}$ that maps $\omega$ onto $\Omega$. Now $K$ is the image of $E$ under $\mathscr{H}$, and $E I \perp A C$. Hence $O K \perp A C$, and thus $K$ is the midpoint of the $\operatorname{arc} C A$. Similarly, $L$ is the midpoint of the arc $B C$ and $M$ is the midpoint of the arc $B A$. It follows that arcs $L M$ and $C K$ are equal, because

$$
\begin{aligned}
\overparen{B M}=\overparen{M A} & \Longrightarrow \overparen{B L}+\overparen{L M}=\overparen{M K}+\overparen{K A} \Longrightarrow \overparen{L C}+\overparen{L M}=\overparen{M K}+\overparen{C K} \\
& \Longrightarrow 2 \overparen{L M}+\overparen{M C}=\overparen{M C}+2 \overparen{C K}
\end{aligned}
$$

Thus arcs $F Q$ and $D E$ of $\omega$ are equal, too, where $D$ is the intersection of $C P$ with $\omega$. Since $C E$ and $C F$ are tangents to $\omega$, this implies that $\angle D E C=\angle C F Q$. Further, $C E=C F$, and thus triangles $C E D$ and $C F Q$ are congruent. In particular, $\angle E C D=\angle Q C F$, as required.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-14.jpg?height=820&width=814&top_left_y=1555&top_left_x=612)

A Variant. As above, we show that $\operatorname{arcs} F Q$ and $D E$ of $\omega$ are equal, which implies that $D E F Q$ is an isoceles trapezoid, and so we have $\angle F E D=\angle Q F E$. Together with $|F Q|=|D E|$, this implies that, since $E$ and $F$ are images of each other under reflection in the angle bisector $C I$ of $\angle C$, so are the segments $[E Q]$ and $[F D]$, and, in particular, $D$ and $Q$. In turn, this yields $\angle E C D=\angle Q C F$, as required.

Remark. Let $J$ denote the incentre of $A B C$. By Sawayama's theorem, $J$ is the midpoint of $[E F]$, i.e. $P J$ is a median of $P F E$. Since $C$ is the intersection of the tangents $A C$ and $B C$ to the circumcircle of $P F E$ at $E$ and $F$, respectively, $P C$ is a symmedian of $P F E$. Thus $\angle C P E=\angle F P J$. But, since the arcs $F Q$ and $D E$ of $\omega$ are equal, $\angle C P E=\angle F P Q$. This shows that $J$ lies on the line $P Q$.

Another Variant. We show that $\operatorname{arcs} Q E$ and $F D$ are equal, and then finish as in the main solution. Let $B P$ meet $\omega$ again at $Z$. Consider the homothety $\mathscr{H}$ that maps $\omega$ onto $\Omega$. Under $\mathscr{H}, D \mapsto C$ and $Z \mapsto B$, so $D Z \| C B$. (This also follows by considering the common tangent to $\omega$ and $\Omega$, and tangential angles.) Now, by power of a point,

$$
B F^{2}=B Z \cdot B P, \quad C F^{2}=C D \cdot C P
$$

Now $D Z \| C B$ implies $B Z / B P=C D / C P$, and so, dividing the two previous equations by each other, and taking square roots, $B F / C F=B P / C P$. Hence $P F$ bissects angle $\angle B P C$. Now let $\angle B P F=\angle F P C=\beta$. By tangential angles, it follows that $\angle C F D=\beta$. Further, $\angle B A C=\angle B P C=2 \beta$. Let the tangent to $\omega$ through $Q$ and parallel to $A B$ meet $A C$ at $X$. Then $\angle Q X C=2 \beta$, so, since $X Q=X E$ by tangency, $\angle Q E X=\beta$. By tangential angles, it follows that $\operatorname{arcs} F D$ and $Q E$ are equal, as claimed.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-15.jpg?height=784&width=806&top_left_y=1600&top_left_x=616)

problem_match: Problem 5. (Proposed by Waldemar Pompe, Poland)


solution:
Let $I$ and $O$ denote the respective centres of $\omega$ and $\Omega$. Observe that $C I$ is the angle bisector of angle $\angle C$, because $\omega$ is tangent to $A C$ and $B C$. Consider the homethety $\mathscr{H}$ that maps $\omega$ onto $\Omega$. Let $M$ be the image of $Q$ under $\mathscr{H}$. By construction, $I Q \perp A B$, so $O M \perp A B$. Thus the diameter $O M$ of $\Omega$ passes through the midpoint of the $\operatorname{arc} A B$ of $\Omega$, which also lies on the angle bisector $C I$. This implies that $\angle I C M=90^{\circ}$. We next show that $P, I, Q, C$ lie on a circle. Notice that

$$
\begin{aligned}
\angle P Q I & =90^{\circ}-\frac{1}{2} \angle Q I P=90^{\circ}-\frac{1}{2} \angle M O P=90^{\circ}-\left(180^{\circ}-\angle P C M\right) \\
& =(\angle P C I+\angle I C M)-90^{\circ}=\angle P C I
\end{aligned}
$$

Hence $P, I, Q, C$ lie on a circle. But $P I=I Q$, so $C I$ is the angle bisector of $\angle P C Q$. Since $C I$ is also the angle bisector of angle $\angle C$, it follows that $\angle A C P=\angle Q C B$, as required.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-16.jpg?height=822&width=798&top_left_y=955&top_left_x=620)

A Variant. We show that $P I Q C$ is cyclic by chasing angles. Define $\alpha=\angle B A C$, $\beta=\angle C B A$ and $\gamma=\angle A C P$. For convenience, we consider the configuration where $A$ and $P$ lie one the same side of the angle bisector $C I$ of $\angle C$. In this configuration,

$$
\angle P C I=\frac{1}{2} \angle A C B-\angle A C P=90^{\circ}-\frac{1}{2} \alpha-\frac{1}{2} \beta-\gamma .
$$

Now notice that $\angle P B A=\angle A C P=\gamma$, and therefore $\angle C A P=180^{\circ}-\beta-\gamma$, whence $\angle P A B=180^{\circ}-\alpha-\beta-\gamma$. Further, $P O$ is a diameter of $\Omega$, and therefore $\angle A P O=90^{\circ}-\gamma$. Let $A B$ and $P O$ intersect at $T$. Then

$$
\angle B T O=180^{\circ}-\angle P A B-\angle A P O=\alpha+\beta+2 \gamma-90^{\circ}
$$

But $Q I \perp A B$ by construction, and thus

$$
\begin{aligned}
& \angle O I Q=90^{\circ}-\angle B T O=180^{\circ}-\alpha-\beta-2 \gamma \\
& \Longrightarrow \quad \angle Q I P=180^{\circ}-\angle O I Q=\alpha+\beta+2 \gamma \\
& \Longrightarrow \quad \angle P Q I=90^{\circ}-\frac{1}{2} \alpha-\frac{1}{2} \beta-\gamma .
\end{aligned}
$$

Hence $\angle I C Q=\angle P Q I$, and thus $P I Q C$ is cyclic. Since $P I=Q I$, it follows that $C I$ is the angle bisector of $\angle P C Q$, which completes the proof.


solution:
Let $I$ and $O$ denote the respective centres of $\omega$ and $\Omega$. Let $D$ be the second point of intersection of $C P$ with $\omega$, and let $\ell$ denote the tangent to $\omega$ at $D$, which meets $A C$ at $S$. Hence $I D \perp \ell$. By construction, $P, I, O$ lie one a line, and hence the isosceles triangles $P I D$ and $P O C$ are similar. In particular, it follows that $O C \perp \ell$, so $C$ is the midpoint of the arc of $\Omega$ defined by the points of intersection of $\ell$ with $\Omega$. It is easy to see that this implies that

$$
\angle D S C=\angle A B C
$$

Under reflection in the angle bisector $C I$ of $\angle C, \ell$ is thus mapped to a tangent to $\omega$ parallel to $A B$ and intersecting the interior of $A B C$, since $\omega$ is mapped to itself under this reflection. In particular, $D$ is mapped to $Q$, and thus $\angle Q C B=\angle A C D$, as required.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-17.jpg?height=790&width=817&top_left_y=1421&top_left_x=611)

Remark. Conceptually, this solution is similar to Solution 1, but here, we proceed more directly via the reflectional symmetry. Therefore, this solution links Solution 1 to Solution 4, in which we use an inversion.


solution:
Let the tangent to $\omega$ at $Q$ meet $A C$ and $B C$ at $X$ and $Y$, respectively. Then $A C / X C=B C / Y C$, and thus there is a radius $r$ such that $r^{2}=A C \cdot Y C=B C \cdot X C$. Let $\Gamma$ denote the circle with centre $C$ and radius $r$, and consider the inversion $\mathscr{I}$ in the circle $\Gamma$. Under $\mathscr{I}$,
$A \longmapsto A^{\prime}$, the point on the ray $C A$ satisfying $C A^{\prime}=C Y$;
$B \longmapsto B^{\prime}$, the point on the ray $C B$ satisfying $C B^{\prime}=C X$;
$\Omega \longmapsto$ the line $A^{\prime} B^{\prime}$;
$\omega \longmapsto \omega^{\prime}$, the excircle of $C A^{\prime} B^{\prime}$ opposite $C$;
$P \longmapsto P^{\prime}$, the point where $\omega^{\prime}$ touches $A^{\prime} B^{\prime}$;
In particular, $\omega^{\prime}$, the image of $\omega$, is a circle tangent to $A C, B C$ and $A^{\prime} B^{\prime}$, so it is either the excircle of $C A^{\prime} B^{\prime}$ opposite $C$, or the incircle of $C A^{\prime} B^{\prime}$. Let $\omega$ be tangent to $B C$ at $F$, and let $F^{\prime}$ be the image of $F$ under $\mathscr{I}$. Then $C F \cdot C F^{\prime}=B C \cdot X C$. Now $C F<B C$, so $C F^{\prime}>C X=C B^{\prime}$. Hence $\omega^{\prime}$ cannot be the incircle, so $\omega^{\prime}$ is indeed the excircle of $C A^{\prime} B^{\prime}$ opposite $C$.

Now note that $\omega$ is the excircle of $C X Y$ opposite $C$. The reflection about the angle bisector of $\angle C$ maps $X$ to $B^{\prime}, Y$ to $A^{\prime}$. It thus maps the triangle $C X Y$ to $C B^{\prime} A^{\prime}, \omega$ to $\omega^{\prime}$ and, finally, $Q$ to $P^{\prime}$. It follows that $\angle A C P=\angle A C P^{\prime}=\angle Q C B$, as required.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-18.jpg?height=822&width=809&top_left_y=1324&top_left_x=612)


solution:
Let $r$ be the radius such that $r^{2}=A C \cdot B C$. Let $\mathscr{J}$ denote the composition of the inversion $\mathscr{I}$ in the circle of centre $C$ and radius $r$, followed by the reflection in the
angle bisector of $\angle C$. Under $\mathscr{J}$,
$A \longmapsto B, B \mapsto A ;$
$\Omega \longmapsto$ the line $A B$;
$\omega \longmapsto \omega^{\prime}$, the excircle of $A B C$ opposite the vertex $C$;
$P \longmapsto Q^{\prime}$, the point where $\omega^{\prime}$ touches $A B$;
In particular, note that the image $\omega^{\prime}$ of $\omega$ under $\mathscr{J}$ is a circle tangent to $A C, B C$ and $A B$, so it is either the incircle of $A B C$, or the excircle opposite vertex $C$. Observe that $r \geqslant \min \{A C, B C\}$, so the image of the points of tangency of $\omega$ must lie outside $A B C$, and thus $\omega^{\prime}$ cannot be the incircle. Thus $\omega^{\prime}$ is the excircle opposite vertex $C$ as claimed. Further, the point of tangency $P$ is mapped to $Q^{\prime}$.

Now, since the line $C P$ is mapped to itself under the inversion $\mathscr{I}$, and mapped onto $C Q^{\prime}$ under $\mathscr{J}, C P$ and $C Q^{\prime}$ are images of each other under reflection in the angle bisector of $\angle C$. But $C, Q, Q^{\prime}$ lie on a line for there is a homothety with centre $C$ that maps $\omega$ onto the excircle $\omega^{\prime}$. This completes the proof.
![](https://cdn.mathpix.com/cropped/2024_11_22_4f3f2266e66f3001a982g-19.jpg?height=942&width=812&top_left_y=1166&top_left_x=613)


solution:
Assume that $\omega$ is tangent to $A C$ and $B C$ at $E$ and $F$, respectively. Assume that $C P$ meets $\omega$ at $D$. Let $I$ and $O$ denote the respective centres of $\omega$ and $\Omega$. To set up a solution in the complex plane, we take the circle $\omega$ as the unit circle centered at the origin of the complex plane, and let $P O$ be the real axis with $o>0$, where we use the convention that lowercase letters denote complex coordinates of corresponding points in the plane denoted by uppercase letters.

Now, a point $Z$ on the circle $\Omega$ satisfies

$$
|z-o|^{2}=(o+1)^{2} \quad \Longleftrightarrow \quad z z^{*}-o\left(z+z^{*}\right)-2 o-1=0
$$

The triangle $A B C$ is defined by the points $E$ and $F$ on $\omega$, the intersection $C$ of the corresponding tangents lying on $\Omega$. Thus $c=2 e f /(e+f)$, and further

$$
|c-o|^{2}=(o+1)^{2} \quad \Longleftrightarrow \quad c c^{*}-o\left(c+c^{*}\right)-2 o-1=0,
$$

and this is the equality defining $o$. The points $A$ and $B$ are the second intersection points of $\Omega$ with the tangents to $\omega$ at $E$ and $F$ respectively. A point $Z$ on the tangent through $E$ is given by $z=2 e-e^{2} z^{*}$, and thus $A$ and $C$ satisfy

$$
\begin{aligned}
\left(2 e-e^{2} z^{*}\right) z^{*} & -o\left(2 e-e^{2} z^{*}+z^{*}\right)-2 o-1=0 \\
& \Longleftrightarrow-e^{2} z^{* 2}+\left(2 e+o e^{2}-o\right) z^{*}-(2 e o+2 o+1)=0 \\
& \Longleftrightarrow z^{* 2}-\left(2 e^{*}+o-o e^{* 2}\right) z^{*}+\left(2 e^{*} o+2 o e^{* 2}+e^{* 2}\right)=0
\end{aligned}
$$

since $|e|=1$. Thus

$$
a^{*}+c^{*}=2 e^{*}+o-o e^{* 2} \quad \Longrightarrow \quad a^{*}=\frac{2 e^{*} f}{e+f}+o\left(1-e^{* 2}\right)
$$

and similarly

$$
b^{*}=\frac{2 f^{*} e}{f+e}+o\left(1-f^{* 2}\right)
$$

Then

$$
\begin{aligned}
b^{*}-a^{*} & =\frac{2\left(e f^{*}-e^{*} f\right)}{e+f}+o\left(e^{* 2}-f^{* 2}\right) \\
& =\frac{2 e f\left(f^{* 2}-e^{* 2}\right)}{e+f}+o\left(e^{* 2}-f^{* 2}\right) \\
& =\left(f^{* 2}-e^{* 2}\right)\left(\frac{2 e f}{e+f}-o\right)=\left(f^{* 2}-e^{* 2}\right)(c-o) .
\end{aligned}
$$

Now let $Z$ be a point on the tangent to $\omega$ parallel to $A B$ passing through $Q$. Then

$$
z=2 q-q^{2} z^{*} \quad \Longleftrightarrow \quad z-q=q-q^{2} z^{*}=-q^{2}\left(z^{*}-q^{*}\right)
$$

for $|q|=1$, and thus

$$
\frac{b-a}{b^{*}-a^{*}}=\frac{z-q}{z^{*}-q^{*}}=\frac{-q^{2}\left(z^{*}-q^{*}\right)}{z^{*}-q^{*}}=-q^{2} .
$$

It follows that

$$
\begin{aligned}
q^{2} & =-\frac{b-a}{b^{*}-a^{*}}=-\frac{\left(f^{2}-e^{2}\right)\left(c^{*}-o\right)}{\left(f^{* 2}-e^{* 2}\right)(c-o)}=e^{2} f^{2} \frac{c^{*}-o}{c-o} \\
& =e^{2} f^{2} \frac{\left(c^{*}-o\right)^{2}}{|c-o|^{2}}=e^{2} f^{2} \frac{\left(c^{*}-o\right)^{2}}{(1+o)^{2}}
\end{aligned}
$$

where we have used (1). In particular,

$$
q=e f \frac{c^{*}-o}{1+o}
$$

where the choice of sign is to be justified a posteriori. Further, the point $D$ satisfies

$$
-d p=\frac{d-p}{d^{*}-p^{*}}=\frac{c-p}{c^{*}-p^{*}} \quad \Longrightarrow \quad d=-\frac{c-p}{c^{*} p-1}=\frac{c+1}{c^{*}+1},
$$

using $p=-1$ to obtain the final equality.
Now, it suffices to show that (i) $D Q \| E F \perp C I$ and (ii) the midpoint of $[D Q]$ is on $C I$. The desired equality then follows by symmetry with respect to the angle bisector of the angle $\angle A C B$. Notice that (i) is equivalent with

$$
\frac{d-q}{d^{*}-q^{*}}=\frac{e-f}{e^{*}-f^{*}} \quad \Longleftrightarrow \quad d q=e f
$$

for $[D Q]$ and $[E F]$ are chords of $\omega$. But

$$
\begin{aligned}
d q=e f & \Longleftrightarrow \frac{c+1}{c^{*}+1} e f \frac{c^{*}-o}{1+o}=e f \quad \Longleftrightarrow \quad(c+1)\left(c^{*}-o\right)=\left(c^{*}+1\right)(1+o) \\
& \Longleftrightarrow c c^{*}-o\left(c+c^{*}\right)-2 o-1=0 .
\end{aligned}
$$

The last equality is precisely the defining relation for $o,(1)$. This proves (i). Further, the midpoint of $[D Q]$ is $\frac{1}{2}(d+q)$, so it remains to check that

$$
d q=\frac{d+q}{d^{*}+q^{*}}=\frac{c}{c^{*}}=e f
$$

where the first equality expresses that $[D Q]$ is a chord of $\omega$ (obviously) containing its midpoint, the second equality expresses the alignment of the midpoint of $[D Q], C$ and $I$, and the third equality follows from the expression for $c$. But we have just shown that $d q=e f$. This proves (ii), justifies the choice of sign for $q$ a posteriori, and thus completes the solution of the problem.


problem:
Snow White and the Seven Dwarves are living in their house in the forest. On each of 16 consecutive days, some of the dwarves worked in the diamond mine while the remaining dwarves collected berries in the forest. No dwarf performed both types of work on the same day. On any two different (not necessarily consecutive) days, at least three dwarves each performed both types of work. Further, on the first day, all seven dwarves worked in the diamond mine.

Prove that, on one of these 16 days, all seven dwarves were collecting berries.

solution:
We define $V$ as the set of all 128 vectors of length 7 with entries in $\{0,1\}$. Every such vector encodes the work schedule of a single day: if the $i$-th entry is 0 then the $i$-th dwarf works in the mine, and if this entry is 1 then the $i$-th dwarf collects berries. The 16 working days correspond to 16 vectors $d_{1}, \ldots, d_{16}$ in $V$, which we will call dayvectors. The condition imposed on any pair of distinct days means that any two distinct day-vectors $d_{i}$ and $d_{j}$ differ in at least three positions.

We say that a vector $x \in V$ covers some vector $y \in V$, if $x$ and $y$ differ in at most one position; note that every vector in $V$ covers exactly eight vectors. For each of the 16 day-vectors $d_{i}$ we define $B_{i} \subset V$ as the set of the eight vectors that are covered by $d_{i}$. As, for $i \neq j$, the day-vectors $d_{i}$ and $d_{j}$ differ in at least three positions, their corresponding sets $B_{i}$ and $B_{j}$ are disjoint. As the sets $B_{1}, \ldots, B_{16}$ together contain $16 \cdot 8=128=|V|$ distinct elements, they form a partition of $V$; in other words, every vector in $V$ is covered by precisely one day-vector.

The weight of a vector $v \in V$ is defined as the number of 1-entries in $v$. For $k=0,1, \ldots, 7$, the set $V$ contains $\binom{7}{k}$ vectors of weight $k$. Let us analyse the 16 dayvectors $d_{1}, \ldots, d_{16}$ by their weights, and let us discuss how the vectors in $V$ are covered by them.

 1. As all seven dwarves work in the diamond mine on the first day, the first day-vector is $d_{1}=(0000000)$. This day-vector covers all vectors in $V$ with weight 0 or 1.
 2. No day-vector can have weight 2 , as otherwise it would differ from $d_{1}$ in at most two positions. Hence each of the $\binom{7}{2}=21$ vectors of weight 2 must be covered by some day-vector of weight 3 . As every vector of weight 3 covers three vectors of weight 2 , exactly $21 / 3=7$ day-vectors have weight 3 .
 3. How are the $\binom{7}{3}=35$ vectors of weight 3 covered by the day-vectors? Seven of them are day-vectors, and the remaining 28 ones must be covered by day-vectors of weight 4 . As every vector of weight 4 covers four vectors of weight 3 , exactly $28 / 4=7$ day-vectors have weight 4.

To summarize, one day-vector has weight 0 , seven have weight 3 , and seven have weight 4 . None of these 15 day-vectors covers any vector of weight 6 or 7 , so that the eight heavyweight vectors in $V$ must be covered by the only remaining day-vector; and this remaining vector must be (1111111). On the day corresponding to (1111111) all seven dwarves are collecting berries, and that is what we wanted to show.

problem_match: Problem 6. (Proposed by Emil Kolev, Bulgaria)


solution:
If a dwarf $X$ performs the same type of work on three days $D_{1}, D_{2}, D_{3}$, then we say that this triple of days is monotonous for $X$. We claim that the following configuration cannot occur: There are three dwarves $X_{1}, X_{2}, X_{3}$ and three days $D_{1}, D_{2}$, $D_{3}$, such that the triple $\left(D_{1}, D_{2}, D_{3}\right)$ is monotonous for each of the dwarves $X_{1}, X_{2}, X_{3}$.
(Proof: Suppose that such a configuration occurs. Then among the remaining dwarves there exist three dwarves $Y_{1}, Y_{2}, Y_{3}$ that performed both types of work on day $D_{1}$ and on day $D_{2}$; without loss of generality these three dwarves worked in the mine on day $D_{1}$ and collected berries on day $D_{2}$. On day $D_{3}$, two of $Y_{1}, Y_{2}, Y_{3}$ performed the same type of work, and without loss of generality $Y_{1}$ and $Y_{2}$ worked in the mine. But then on days $D_{1}$ and $D_{3}$, each of the five dwarves $X_{1}, X_{2}, X_{3}, Y_{1}, Y_{2}$ performed only one type of work; this is in contradiction with the problem statement.)

Next we consider some fixed triple $X_{1}, X_{2}, X_{3}$ of dwarves. There are eight possible working schedules for $X_{1}, X_{2}, X_{3}$ (like mine-mine-mine, mine-mine-berries, mine-berriesmine, etc). As the above forbidden configuration does not occur, each of these eight working schedules must occur on exactly two of the sixteen days. In particular this implies that every dwarf worked exactly eight times in the mine and exactly eight times in the forest.

For $0 \leqslant k \leqslant 7$ we denote by $d(k)$ the number of days on which exactly $k$ dwarves were collecting berries. Since on the first day all seven dwarves were in the mine, on each of the remaining days at least three dwarves collected berries. This yields $d(0)=1$ and $d(1)=d(2)=0$. We assume, for the sake of contradiction, that $d(7)=0$ and hence

$$
d(3)+d(4)+d(5)+d(6)=15
$$

As every dwarf collected berries exactly eight times, we get that, further,

$$
3 d(3)+4 d(4)+5 d(5)+6 d(6)=7 \cdot 8=56
$$

Next, let us count the number $q$ of quadruples $\left(X_{1}, X_{2}, X_{3}, D\right)$ for which $X_{1}, X_{2}, X_{3}$ are three pairwise distinct dwarves that all collected berries on day $D$. As there are $7 \cdot 6 \cdot 5=210$ triples of pairwise distinct dwarves, and as every working schedule for three fixed dwarves occurs on exactly two days, we get $q=420$. As every day on which $k$ dwarves collect berries contributes $k(k-1)(k-2)$ such quadruples, we also have

$$
3 \cdot 2 \cdot 1 \cdot d(3)+4 \cdot 3 \cdot 2 \cdot d(4)+5 \cdot 4 \cdot 3 \cdot d(5)+6 \cdot 5 \cdot 4 \cdot d(6)=q=420
$$

which simplifies to

$$
d(3)+4 d(4)+10 d(5)+20 d(6)=70
$$

Finally, we count the number $r$ of quadruples $\left(X_{1}, X_{2}, X_{3}, D\right)$ for which $X_{1}, X_{2}, X_{3}$ are three pairwise distinct dwarves that all worked in the mine on day $D$. Similarly as above we see that $r=420$ and that

$$
7 \cdot 6 \cdot 5 \cdot d(0)+4 \cdot 3 \cdot 2 \cdot d(3)+3 \cdot 2 \cdot 1 \cdot d(4)=r=420
$$

which simplifies to

$$
4 d(3)+d(4)=35
$$

Multiplying (1) by -40 , multiplying (2) by 10 , multiplying (3) by -1 , multiplying (4) by 4 , and then adding up the four resulting equations yields $5 d(3)=30$ and hence $d(3)=6$. Then (4) yields $d(4)=11$. As $d(3)+d(4)=17$, the total number of days cannot be 16 . We have reached the desired contradiction.

A Variant. We follow the second solution up to equation (3). Multiplying (1) by 8 , multiplying (2) by -3 , and adding the two resulting equations to (3) yields

$$
3 d(5)+10 d(6)=22
$$

As $d(5)$ and $d(6)$ are positive integers, (5) implies $0 \leqslant d(6) \leqslant 2$. Only the case $d(6)=1$ yields an integral value $d(5)=4$. The equations (1) and (2) then yield $d(3)=10$ and $d(4)=0$.

Now let us look at the $d(3)=10$ special days on which exactly three dwarves were collecting berries. One of the dwarves collected berries on at least five special days (if every dwarf collected berries on at most four special days, this would allow at most $7 \cdot 4 / 3<10$ special days); we call this dwarf $X$. On at least two out of these five special days, some dwarf $Y$ must have collected berries together with $X$. Then these two days contradict the problem statement. We have reached the desired contradiction.

Comment. Up to permutations of the dwarves, there exists a unique set of day-vectors (as introduced in the first solution) that satisfies the conditions of the problem statement:

| 0000000 | 1110000 | 1001100 | 1000011 | 0101010 | 0100101 | 0010110 | 0011001 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 1111111 | 0001111 | 0110011 | 0111100 | 1010101 | 1011010 | 1101001 | 1100110 |