problem: Find all real-valued functions $f$ defined on pairs of real numbers, having the following property: for all real numbers $a, b, c$, the median of $f(a, b), f(b, c), f(c, a)$ equals the median of $a, b, c$. (The median of three real numbers, not necessarily distinct, is the number that is in the middle when the three numbers are arranged in nondecreasing order.)

solution: We prove the following main claim, from which repeated applications can deduce the problem.  Claim - Let $a<b<c$ be arbitrary. On $\{a, b, c\}^{2}, f$ takes one of the following two forms, where the column indicates the $x$-value and the row indicates the $y$-value.  | $f$ | $a$ | $b$ | $c$ | | ---: | ---: | ---: | ---: | | $a$ | $a$ | $b$ | $\geq c$ | | $b$ | $\leq a$ | $b$ | $\geq c$ | | $c$ | $\leq a$ | $b$ | $c$ |  or  | $f$ | $a$ | $b$ | $c$ | | ---: | ---: | ---: | ---: | | $a$ | $a$ | $\leq a$ | $\leq a$ | | $b$ | $b$ | $b$ | $b$ | | $c$ | $\geq c$ | $\geq c$ | $c$ |   - By considering the assertion for $(a, a, c)$ and $(a, c, c)$ we see that one of $f(a, c)$ and $f(c, a)$ is $\geq c$ and the other is $\leq a$. - Hence, by considering $(a, b, c)$ we find that one of $f(a, b)$ and $f(b, c)$ must be $b$, and similarly for $f(b, a)$ and $f(c, b)$. - Now, WLOG $f(b, a)=b$; we prove we get the first case. - By considering $(a, a, b)$ we deduce $f(a, b) \leq a$, so $f(b, c)=b$ and then $f(c, b) \geq c$. - Finally, considering $(c, b, a)$ once again in conjunction with the first bullet, we arrive at the conclusion that $f(a, c) \leq a$; similarly $f(c, a) \geq c$.  From this it's easy to obtain that $f(x, y) \equiv x$ or $f(x, y) \equiv y$ are the only solutions.


problem: Two circles $\omega_{1}$ and $\omega_{2}$ intersect at points $A$ and $B$. Line $\ell$ is tangent to $\omega_{1}$ at $P$ and to $\omega_{2}$ at $Q$ so that $A$ is closer to $\ell$ than $B$. Let $X$ and $Y$ be points on major $\operatorname{arcs} \widehat{P A}\left(\right.$ on $\left.\omega_{1}\right)$ and $\overparen{A Q}$ (on $\left.\omega_{2}\right)$, respectively, such that $A X / P X=A Y / Q Y=c$. Extend segments $P A$ and $Q A$ through $A$ to $R$ and $S$, respectively, such that $A R=A S=c \cdot P Q$. Given that the circumcenter of triangle $A R S$ lies on line $X Y$, prove that $\angle X P A=\angle A Q Y$.

solution: We begin as follows: Claim - There is a spiral similarity centered at $X$ mapping $A R$ to $P Q$. Similarly there is a spiral similarity centered at $Y$ mapping $S A$ to $P Q$.  Now the composition of the two spiral similarities  $$ A R \stackrel{X}{\mapsto} P Q \stackrel{Y}{\mapsto} S A $$  must be a rotation, since $A R=A S$. The center of this rotation must coincide with the circumcenter $O$ of $\triangle A R S$, which is known to lie on line $X Y$. ![](https://cdn.mathpix.com/cropped/2024_11_19_4b79ccb9f247e3679ea0g-04.jpg?height=786&width=1012&top_left_y=1486&top_left_x=522)  As $O$ is a fixed-point of the composed map above, we may let $O^{\prime}$ be the image of $O$ under the rotation at $X$, so that  $$ \triangle X P A \AA \triangle X O^{\prime} O, \quad \triangle Y Q A \AA \triangle Y O^{\prime} O . $$  Because  $$ \frac{X O}{X O^{\prime}}=\frac{X A}{X P}=c \frac{Y Q}{Y A}=\frac{Y O}{Y O^{\prime}} $$  it follows $\overline{O^{\prime} O}$ bisects $\angle X O^{\prime} Y$. Finally, we have  $$ \measuredangle X P A=\measuredangle X O^{\prime} O=\measuredangle O O^{\prime} Y=\measuredangle A Q Y $$  Remark. Indeed, this also shows $\overline{X P} \| \overline{Y Q}$; so the positive homothety from $\omega_{1}$ to $\omega_{2}$ maps $P$ to $Q$ and $X$ to $Y$.


problem: Prove that there exists a real constant $c$ such that for any pair $(x, y)$ of real numbers, there exist relatively prime integers $m$ and $n$ satisfying the relation  $$ \sqrt{(x-m)^{2}+(y-n)^{2}}<c \log \left(x^{2}+y^{2}+2\right) . $$

solution: This is actually the same problem as USAMO 2014/6. Surprise!


problem: Acute triangle $A B C$ is inscribed in circle $\omega$. Let $H$ and $O$ denote its orthocenter and circumcenter, respectively. Let $M$ and $N$ be the midpoints of sides $A B$ and $A C$, respectively. Rays $M H$ and $N H$ meet $\omega$ at $P$ and $Q$, respectively. Lines $M N$ and $P Q$ meet at $R$. Prove that $\overline{O A} \perp \overline{R A}$.

solution: Let $M H$ and $N H$ meet the nine-point circle again at $P^{\prime}$ and $Q^{\prime}$, respectively. Recall that $H$ is the center of the homothety between the circumcircle and the nine-point circle. From this we can see that $P$ and $Q$ are the images of this homothety, meaning that  $$ H Q=2 H Q^{\prime} \quad \text { and } \quad H P=2 H P^{\prime} $$  Since $M, P^{\prime}, Q^{\prime}, N$ are cyclic, Power of a Point gives us  $$ M H \cdot H P^{\prime}=H N \cdot H Q^{\prime} $$  Multiplying both sides by two, we thus derive  $$ H M \cdot H P=H N \cdot H Q $$  It follows that the points $M, N, P, Q$ are concyclic. ![](https://cdn.mathpix.com/cropped/2024_11_19_4b79ccb9f247e3679ea0g-07.jpg?height=721&width=1109&top_left_y=1541&top_left_x=482)  Let $\omega_{1}, \omega_{2}, \omega_{3}$ denote the circumcircles of $M N P Q, A M N$, and $A B C$, respectively. The radical axis of $\omega_{1}$ and $\omega_{2}$ is line $M N$, while the radical axis of $\omega_{1}$ and $\omega_{3}$ is line $P Q$. Hence the line $R$ lies on the radical axis of $\omega_{2}$ and $\omega_{3}$.  But we claim that $\omega_{2}$ and $\omega_{3}$ are internally tangent at $A$. This follows by noting the homothety at $A$ with ratio 2 sends $M$ to $B$ and $N$ to $C$. Hence the radical axis of $\omega_{2}$ and $\omega_{3}$ is a line tangent to both circles at $A$.  Hence $\overline{R A}$ is tangent to $\omega_{3}$. Therefore, $\overline{R A} \perp \overline{O A}$.


problem: At a certain orphanage, every pair of orphans are either friends or enemies. For every three of an orphan's friends, an even number of pairs of them are enemies. Prove that it's possible to assign each orphan two parents such that every pair of friends shares exactly one parent, but no pair of enemies does, and no three parents are in a love triangle (where each pair of them has a child).

solution: Of course, we consider the graph with vertices as children and edges as friendships. Consider all the maximal cliques in the graph (i.e. repeatedly remove maximal cliques until no edges remain; thus all edges are in some clique).  Claim - Every vertex is in at most two maximal cliques.  Now, for every maximal clique we assign a particular parent to all vertices in that clique, adding in additional distinct parents if there are any deficient children. This satisfies the friendship/enemy condition. Moreover, one can readily check that there are no love triangles: given children $a, b, c$ such that $a$ and $b$ share a parent while $a$ and $c$ share another parent, according to the claim $b$ and $c$ can't share a third parent. This completes the problem.   Ironically, the condition that there be no love triangle actually makes the problem easier, because it tells us exactly what to do!


solution: We will prove the inequality for any $a, b, c$ the sides of a possibly degenerate triangle (which is implied by the condition), ignoring the particular constant 1. Homogenizing, we instead prove the problem in the following form:  Claim - We have  $$ k^{2} \leq(k-a)^{2}+(k-b)^{2}+(k-c)^{2}+\frac{2 \sqrt{2} a b c}{\sqrt{a^{2}+b^{2}+c^{2}}} $$  for any $a, b, c, k$ with $(a, b, c)$ the sides of a possibly degenerate triangle.  Letting $x=\frac{1}{2}(b+c-a)$ as is usual, the problem rearranges to In that case, the problem amounts to  $$ (x+y+z)^{2} \leq x^{2}+y^{2}+z^{2}+\frac{2(x+y)(y+z)(z+x)}{\sqrt{x^{2}+y^{2}+z^{2}+x y+y z+z x}} $$  or equivalently  $$ x^{2}+y^{2}+z^{2}+x y+y z+z x \leq\left(\frac{(x+y)(y+z)(z+x)}{x y+y z+z x}\right)^{2} . $$  To show this, one may let $t=x y+y z+z x$, then using $(x+y)(x+z)=x^{2}+B$ this becomes  $$ t^{2}\left(x^{2}+y^{2}+z^{2}+t\right) \leq\left(x^{2}+t\right)\left(y^{2}+t\right)\left(z^{2}+t\right) $$  which is obvious upon expansion. Remark. The inequality holds actually for all real numbers $a, b$, $c$, with very disgusting proofs.


problem: Let $A B C$ be a triangle. Its excircles touch sides $B C, C A, A B$ at $D, E, F$. Prove that the perimeter of triangle $A B C$ is at most twice that of triangle $D E F$.

solution: $$ \begin{aligned} -s+\sum_{\mathrm{cyc}} E F & \geq-s+\sum_{\mathrm{cyc}}[a-(s-a)(\cos B+\cos C)] \\ & =s-\sum_{\mathrm{cyc}} a \cos A=\sum_{\mathrm{cyc}} a\left(\frac{1}{2}-\cos A\right) \\ & =R \sum_{\mathrm{cyc}} \sin A(1-2 \cos A) \\ & =R \sum_{\mathrm{cyc}}(\sin A-\sin 2 A) \end{aligned} $$  Thus we're done upon noting that  $$ \frac{\sin 2 B+\sin 2 C}{2}=\sin (B+C) \cos (B-C)=\sin A \cos (B-C) \leq \sin A $$  (Alternatively, one can avoid trigonometry by substituting $\cos A=\frac{b^{2}+c^{2}-a^{2}}{2 b c}$ and doing some routine but long calculation.)


problem: Let $x_{0}, x_{1}, \ldots, x_{n_{0}-1}$ be integers, and let $d_{1}, d_{2}, \ldots, d_{k}$ be positive integers with $n_{0}=d_{1}>d_{2}>\cdots>d_{k}$ and $\operatorname{gcd}\left(d_{1}, d_{2}, \ldots, d_{k}\right)=1$. For every integer $n \geq n_{0}$, define  $$ x_{n}=\left\lfloor\frac{x_{n-d_{1}}+x_{n-d_{2}}+\cdots+x_{n-d_{k}}}{k}\right\rfloor . $$  Show that the sequence $\left(x_{n}\right)$ is eventually constant.

solution: Note that if the initial terms are contained in some interval $[A, B]$ then they will remain in that interval. Thus the sequence is eventually periodic. Discard initial terms and let the period be $T$; we will consider all indices modulo $T$ from now on.  Let $M$ be the maximal term in the sequence (which makes sense since the sequence is periodic). Note that if $x_{n}=M$, we must have $x_{n-d_{i}}=M$ for all $i$ as well. By taking a linear combination $\sum c_{i} d_{i} \equiv 1(\bmod T)($ possibly be Bezout's theorem, since $\operatorname{gcd}_{i}\left(d_{i}\right)=1$ ), we conclude $x_{n-1}=M$, as desired.


problem: Let $n$ be a positive integer. Suppose we are given $2^{n}+1$ distinct sets, each containing finitely many objects. Place each set into one of two categories, the red sets and the blue sets, so that there is at least one set in each category. We define the symmetric difference of two sets as the set of objects belonging to exactly one of the two sets. Prove that there are at least $2^{n}$ different sets which can be obtained as the symmetric difference of a red set and a blue set.

solution: We can interpret the problem as working with binary strings of length $\ell \geq n+1$, with $\ell$ the number of elements across all sets.  Let $F$ be a field of cardinality $2^{\ell}$, hence $F \cong \mathbb{F}_{2}^{\oplus \ell}$. Then, we can think of red/blue as elements of $F$, so we have some $B \subseteq F$, and an $R \subseteq F$. We wish to prove that $|B+R| \geq 2^{n}$. Want $|B+R| \geq 2^{n}$.  Equivalently, any element of a set $X$ with $|X|=2^{n}-1$ should omit some element of $|B+R|$. To prove this: we know $|B|+|R|=2^{n}+1$, and define  $$ P(b, r)=\prod_{x \in X}(b+r-x) $$  Consider $b^{|B|-1} r^{|R|-1}$. The coefficient of is $\binom{2^{n}-1}{|B|-1}$, which is odd (say by Lucas theorem), so the nullstellensatz applies.