Find all functions $f: \mathbb{R}\rightarrow \mathbb{R}$ such that \[ f(xy-1) + f(x)f(y) = 2xy-1 \]for all x and y
2017 Peru IMO TST
pre - selection
Let $n\geq3$ an integer. Mario draws $20$ lines in the plane, such that there are not two parallel lines. For each equilateral triangle formed by three of these lines, Mario receives three coins. For each isosceles and non-equilateral triangle (at the same time) formed by three of these lines, Mario receives a coin. How is the maximum number of coins that can Mario receive?
The inscribed circle of the triangle $ABC$ is tangent to the sides $BC, AC$ and $AB$ at points $D, E$ and $F$, respectively. Let $M$ be the midpoint of $EF$. The circle circumscribed around the triangle $DMF$ intersects line $AB$ at $L$, the circle circumscribed around the triangle $DME$ intersects the line $AC$ at $K$. Prove that the circle circumscribed around the triangle $AKL$ is tangent to the line $BC$.
The product $1\times 2\times 3\times ...\times n$ is written on the board. For what integers $n \ge 2$, we can add exclamation marks to some factors to convert them into factorials, in such a way that the final product can be a perfect square?
day 1
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. \]
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 $I$ be the incentre of a non-equilateral triangle $ABC$, $I_A$ be the $A$-excentre, $I'_A$ be the reflection of $I_A$ in $BC$, and $l_A$ be the reflection of line $AI'_A$ in $AI$. Define points $I_B$, $I'_B$ and line $l_B$ analogously. Let $P$ be the intersection point of $l_A$ and $l_B$. Prove that $P$ lies on line $OI$ where $O$ is the circumcentre of triangle $ABC$. Let one of the tangents from $P$ to the incircle of triangle $ABC$ meet the circumcircle at points $X$ and $Y$. Show that $\angle XIY = 120^{\circ}$.
day 2
The leader of an IMO team chooses positive integers $n$ and $k$ with $n > k$, and announces them to the deputy leader and a contestant. The leader then secretly tells the deputy leader an $n$-digit binary string, and the deputy leader writes down all $n$-digit binary strings which differ from the leader’s in exactly $k$ positions. (For example, if $n = 3$ and $k = 1$, and if the leader chooses $101$, the deputy leader would write down $001, 111$ and $100$.) The contestant is allowed to look at the strings written by the deputy leader and guess the leader’s string. What is the minimum number of guesses (in terms of $n$ and $k$) needed to guarantee the correct answer?
Let $ABCD$ be a cyclie quadrilateral, $\omega$ be it's circumcircle and $M$ be the midpoint of the arc $AB$ of $\omega$ which does not contain the vertices $C$ and $D$. The line that passes through $M$ and the intersection point of segments $AC$ and $BD$, intersects again $\omega$ in $N$. Let $P$ and $Q$ be points in the $CD$ segment such that $\angle AQD = \angle DAP$ and $\angle BPC = \angle CBQ$. Prove that the circumcircle of $NPQ$ and $\omega$ are tangent to each other.
Let $P (n)$ and $Q (n)$ be two polynomials (not constant) whose coefficients are integers not negative. For each positive integer $n$, define $x_n = 2016^{P (n)} + Q (n)$. Prove that there exist infinite primes $p$ for which there is a positive integer $m$, squarefree, such that $p | x_m$. Clarification: A positive integer is squarefree if it is not divisible by the square of any prime number.
day 3
Let $ABC$ be an acute and scalene of circumcircle $\Gamma$ and orthocenter $H$. Let $A_1,B_1,C_1$ be the second intersection points of the lines $AH, BH, CH$ with $\Gamma$, respectively. The lines that pass through $A_1,B_1,C_1$ and are parallel to $BC,CA, AB$ intersect again to $\Gamma$ at $A_2,B_2,C_2$, respectively. Let $M$ be the intersection point of $AC_2$ and $BC_1, N$ the intersection point of $BA_2$ and $CA_1$, and $P$ the intersection point of $CB_2$ and $AB_1$. Prove that $\angle MNB = \angle AMP$ .
Let $a$ be a positive integer which is not a perfect square, and consider the equation \[k = \frac{x^2-a}{x^2-y^2}.\]Let $A$ be the set of positive integers $k$ for which the equation admits a solution in $\mathbb Z^2$ with $x>\sqrt{a}$, and let $B$ be the set of positive integers for which the equation admits a solution in $\mathbb Z^2$ with $0\leq x<\sqrt{a}$. Show that $A=B$.
Find all functions $f:\mathbb{R}\rightarrow\mathbb{R}$ such that $f(0)\neq 0$ and for all $x,y\in\mathbb{R}$, \[ f(x+y)^2 = 2f(x)f(y) + \max \left\{ f(x^2+y^2), f(x^2)+f(y^2) \right\}. \]
day 4
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
Consider fractions $\frac{a}{b}$ where $a$ and $b$ are positive integers. (a) Prove that for every positive integer $n$, there exists such a fraction $\frac{a}{b}$ such that $\sqrt{n} \le \frac{a}{b} \le \sqrt{n+1}$ and $b \le \sqrt{n}+1$. (b) Show that there are infinitely many positive integers $n$ such that no such fraction $\frac{a}{b}$ satisfies $\sqrt{n} \le \frac{a}{b} \le \sqrt{n+1}$ and $b \le \sqrt{n}$.
Let $n$ and $k$ be positive integers. A simple graph $G$ does not contain any cycle whose length be an odd number greater than $1$ and less than $ 2k + 1$. If $G$ has at most $n + \frac{(k-1) (n-1) (n+2)}{2}$ vertices, prove that the vertices of $G$ can be painted with $n$ colors in such a way that any edge of $G$ has its ends of different colors.