2023 Spain Mathematical Olympiad

Day 1

1

A $3\times 3\times 3$ cube is made of 27 unit cube pieces. Each piece contains a lamp, which can be on or off. Every time a piece is pressed (the center piece cannot be pressed), the state of that piece and the pieces that share a face with it changes. Initially all lamps are off. Determine which of the following states are achievable: (1) All lamps are on. (2) All lamps are on except the central one. (3) Only the central lamp is on.

2

Let $ABC$ be an acute scalene triangle with incenter $I$ and orthocenter $H$. Let $M$ be the midpoint of $AB$. On the line $AH$ we consider points $D$ and $E$, such that the line $MD$ is parallel to $CI$ and $ME$ is perpendicular to $CI$. Prove that $AE=DH$.

3

Find all quadruples $(a,b,c,d)$ of positive integers satisfying that $a^2+b^2=c^2+d^2$ and such that $ac+bd$ divides $a^2+b^2$.

Day 2

4

Let $x_1\leq x_2\leq x_3\leq x_4$ be real numbers. Prove that there exist polynomials of degree two $P(x)$ and $Q(x)$ with real coefficients such that $x_1$, $x_2$, $x_3$ and $x_4$ are the roots of $P(Q(x))$ if and only if $x_1+x_4=x_2+x_3$.

5

We have a row of 203 cells. Initially the leftmost cell contains 203 tokens, and the rest are empty. On each move we can do one of the following: 1)Take one token, and move it to an adjacent cell (left or right). 2)Take exactly 20 tokens from the same cell, and move them all to an adjacent cell (all left or all right). After 2023 moves each cell contains one token. Prove that there exists a token that moved left at least nine times.

6

In an acute scalene triangle $ABC$ with incenter $I$, the line $AI$ intersects the circumcircle again at $D$, and let $J$ be a point such that $D$ is the midpoint of $IJ$. Consider points $E$ and $F$ on line $BC$ such that $IE$ and $JF$ are perpendicular to $AI$. Consider points $G$ on $AE$ and $H$ on $AF$ such that $IG$ and $JH$ are perpendicular to $AE$ and $AF$, respectively. Prove that $BG=CH$.