Let $ABC$ be an acute triangle. Points $X$ and $Y$ lie on the segments $AB$ and $AC$, respectively, such that $AX=AY$ and the segment $XY$ passes through the orthocenter of the triangle $ABC$. Lines tangent to the circumcircle of the triangle $AXY$ at points $X$ and $Y$ intersect at point $P$. Prove that points $A, B, C, P$ are concyclic.
2019 Polish MO Finals
Day 1
Let $p$ a prime number and $r$ an integer such that $p|r^7-1$. Prove that if there exist integers $a, b$ such that $p|r+1-a^2$ and $p|r^2+1-b^2$, then there exist an integer $c$ such that $p|r^3+1-c^2$.
$n\ge 3$ guests met at a party. Some of them know each other but there is no quartet of different guests $a, b, c, d$ such that in pairs $\lbrace a, b \rbrace, \lbrace b, c \rbrace, \lbrace c, d \rbrace, \lbrace d, a \rbrace$ guests know each other but in pairs $\lbrace a, c \rbrace, \lbrace b, d \rbrace$ guests don't know each other. We say a nonempty set of guests $X$ is an ingroup, when guests from $X$ know each other pairwise and there are no guests not from $X$ knowing all guests from $X$. Prove that there are at most $\frac{n(n-1)}{2}$ different ingroups at that party.
Day 2
Let $n, k, \ell$ be positive integers and $\sigma : \lbrace 1, 2, \ldots, n \rbrace \rightarrow \lbrace 1, 2, \ldots, n \rbrace$ an injection such that $\sigma(x)-x\in \lbrace k, -\ell \rbrace$ for all $x\in \lbrace 1, 2, \ldots, n \rbrace$. Prove that $k+\ell|n$.
The sequence $a_1, a_2, \ldots, a_n$ of positive real numbers satisfies the following conditions: \begin{align*} \sum_{i=1}^n \frac{1}{a_i} \le 1 \ \ \ \ \hbox{and} \ \ \ \ a_i \le a_{i-1}+1 \end{align*}for all $i\in \lbrace 1, 2, \ldots, n \rbrace$, where $a_0$ is an integer. Prove that \begin{align*} n \le 4a_0 \cdot \sum_{i=1}^n \frac{1}{a_i} \end{align*}
Denote by $\Omega$ the circumcircle of the acute triangle $ABC$. Point $D$ is the midpoint of the arc $BC$ of $\Omega$ not containing $A$. Circle $\omega$ centered at $D$ is tangent to the segment $BC$ at point $E$. Tangents to the circle $\omega$ passing through point $A$ intersect line $BC$ at points $K$ and $L$ such that points $B, K, L, C$ lie on the line $BC$ in that order. Circle $\gamma_1$ is tangent to the segments $AL$ and $BL$ and to the circle $\Omega$ at point $M$. Circle $\gamma_2$ is tangent to the segments $AK$ and $CK$ and to the circle $\Omega$ at point $N$. Lines $KN$ and $LM$ intersect at point $P$. Prove that $\sphericalangle KAP = \sphericalangle EAL$.