Find the smallest constant $C > 0$ for which the following statement holds: among any five positive real numbers $a_1,a_2,a_3,a_4,a_5$ (not necessarily distinct), one can always choose distinct subscripts $i,j,k,l$ such that \[ \left| \frac{a_i}{a_j} - \frac {a_k}{a_l} \right| \le C. \]
2017 Ukraine Team Selection Test
Day 1
Denote by $\mathbb{N}$ the set of all positive integers. Find all functions $f:\mathbb{N}\rightarrow \mathbb{N}$ such that for all positive integers $m$ and $n$, the integer $f(m)+f(n)-mn$ is nonzero and divides $mf(m)+nf(n)$. Proposed by Dorlir Ahmeti, Albania
Andriyko has rectangle desk and a lot of stripes that lie parallel to sides of the desk. For every pair of stripes we can say that first of them is under second one. In desired configuration for every four stripes such that two of them are parallel to one side of the desk and two others are parallel to other side, one of them is under two other stripes that lie perpendicular to it. Prove that Andriyko can put stripes one by one such way that every next stripe lie upper than previous and get desired configuration. Proposed by Denys Smirnov
Day 2
Whether exist set $A$ that contain 2016 real numbers (some of them may be equal) not all of which equal 0 such that next statement holds. For arbitrary 1008-element subset of $A$ there is a monic polynomial of degree 1008 such that elements of this subset are roots of the polynomial and other 1008 elements of $A$ are coefficients of this polynomial's degrees from 0 to 1007.
Let $n$ be a positive integer relatively prime to $6$. We paint the vertices of a regular $n$-gon with three colours so that there is an odd number of vertices of each colour. Show that there exists an isosceles triangle whose three vertices are of different colours.
Let $ABCD$ be a convex quadrilateral with $\angle ABC = \angle ADC < 90^{\circ}$. The internal angle bisectors of $\angle ABC$ and $\angle ADC$ meet $AC$ at $E$ and $F$ respectively, and meet each other at point $P$. Let $M$ be the midpoint of $AC$ and let $\omega$ be the circumcircle of triangle $BPD$. Segments $BM$ and $DM$ intersect $\omega$ again at $X$ and $Y$ respectively. Denote by $Q$ the intersection point of lines $XE$ and $YF$. Prove that $PQ \perp AC$.
Day 3
For any positive integer $k$, denote the sum of digits of $k$ in its decimal representation by $S(k)$. Find all polynomials $P(x)$ with integer coefficients such that for any positive integer $n \geq 2016$, the integer $P(n)$ is positive and $$S(P(n)) = P(S(n)).$$ Proposed by Warut Suksompong, Thailand
Let $B = (-1, 0)$ and $C = (1, 0)$ be fixed points on the coordinate plane. A nonempty, bounded subset $S$ of the plane is said to be nice if $\text{(i)}$ there is a point $T$ in $S$ such that for every point $Q$ in $S$, the segment $TQ$ lies entirely in $S$; and $\text{(ii)}$ for any triangle $P_1P_2P_3$, there exists a unique point $A$ in $S$ and a permutation $\sigma$ of the indices $\{1, 2, 3\}$ for which triangles $ABC$ and $P_{\sigma(1)}P_{\sigma(2)}P_{\sigma(3)}$ are similar. Prove that there exist two distinct nice subsets $S$ and $S'$ of the set $\{(x, y) : x \geq 0, y \geq 0\}$ such that if $A \in S$ and $A' \in S'$ are the unique choices of points in $\text{(ii)}$, then the product $BA \cdot BA'$ is a constant independent of the triangle $P_1P_2P_3$.
There're two positive inegers $a_1<a_2$. For every positive integer $n \geq 3$ let $a_n$ be the smallest integer that bigger than $a_{n-1}$ and such that there's unique pair $1\leq i< j\leq n-1$ such that this number equals to $a_i+a_j$. Given that there're finitely many even numbers in this sequence. Prove that sequence $\{a_{n+1}-a_n \}$ is periodic starting from some element.
Day 4
Find all positive integers $n$ for which all positive divisors of $n$ can be put into the cells of a rectangular table under the following constraints: each cell contains a distinct divisor; the sums of all rows are equal; and the sums of all columns are equal.
Let $ABC$ be a triangle with circumcircle $\Gamma$ and incenter $I$ and let $M$ be the midpoint of $\overline{BC}$. The points $D$, $E$, $F$ are selected on sides $\overline{BC}$, $\overline{CA}$, $\overline{AB}$ such that $\overline{ID} \perp \overline{BC}$, $\overline{IE}\perp \overline{AI}$, and $\overline{IF}\perp \overline{AI}$. Suppose that the circumcircle of $\triangle AEF$ intersects $\Gamma$ at a point $X$ other than $A$. Prove that lines $XD$ and $AM$ meet on $\Gamma$. Proposed by Evan Chen, Taiwan
Let $m_1,m_2,...,m_{2013} > 1$ be 2013 pairwise relatively prime positive integers and $A_1,A_2,...,A_{2013}$ be 2013 (possibly empty) sets with $A_i\subseteq \{1,2,...,m_i-1\}$ for $i=1,2,...,2013$. Prove that there is a positive integer $N$ such that \[ N \le \left( 2\left\lvert A_1 \right\rvert + 1 \right)\left( 2\left\lvert A_2 \right\rvert + 1 \right)\cdots\left( 2\left\lvert A_{2013} \right\rvert + 1 \right) \] and for each $i = 1, 2, ..., 2013$, there does not exist $a \in A_i$ such that $m_i$ divides $N-a$. Proposed by Victor Wang