Denote $U$ as the set of $20$ diagonals of the regular polygon $P_1P_2P_3P_4P_5P_6P_7P_8$. Find the number of sets $S$ which satisfies the following conditions. 1. $S$ is a subset of $U$. 2. If $P_iP_j \in S$ and $P_j P_k \in S$, and $i \neq k$, $P_iP_k \in S$.
2017 Korea National Olympiad
Day 1
Find all primes $p$ such that there exist an integer $n$ and positive integers $k, m$ which satisfies the following. $$ \frac{(mk^2+2)p-(m^2+2k^2)}{mp+2} = n^2$$
Let there be a scalene triangle $ABC$, and its incircle hits $BC, CA, AB$ at $D, E, F$. The perpendicular bisector of $BC$ meets the circumcircle of $ABC$ at $P, Q$, where $P$ is on the same side with $A$ with respect to $BC$. Let the line parallel to $AQ$ and passing through $D$ meet $EF$ at $R$. Prove that the intersection between $EF$ and $PQ$ lies on the circumcircle of $BCR$.
Let $f: \mathbb{R} \rightarrow \mathbb{R}$ be the function as \[ f(x) = \begin{cases} \frac{1}{x-1}& (x > 1)\\ 1& (x=1)\\ \frac{x}{1-x} & (x<1) \end{cases} \]Let $x_1$ be a positive irrational number which is a zero of a quadratic polynomial with integer coefficients. For every positive integer $n$, let $x_{n+1} = f(x_n)$. Prove that there exists different positive integers $k$ and $\ell$ such that $x_k = x_\ell$.
Day 2
Given a prime $p$, show that there exist two integers $a, b$ which satisfies the following. For all integers $m$, $m^3+ 2017am+b$ is not a multiple of $p$.
In a quadrilateral $ABCD$, we have $\angle ACB = \angle ADB = 90$ and $CD < BC$. Denote $E$ as the intersection of $AC$ and $BD$, and let the perpendicular bisector of $BD$ hit $BC$ at $F$. The circle with center $F$ which passes through $B$ hits $AB$ at $P (\neq B)$ and $AC$ at $Q$. Let $M$ be the midpoint of $EP$. Prove that the circumcircle of $EPQ$ is tangent to $AB$ if and only if $B, M, Q$ are colinear.
Find all real numbers $c$ such that there exists a function $f: \mathbb{R}_{ \ge 0} \rightarrow \mathbb{R}$ which satisfies the following. For all nonnegative reals $x, y$, $f(x+y^2) \ge cf(x)+y$. Here $\mathbb{R}_{\ge 0}$ is the set of all nonnegative reals.
For a positive integer $n$, there is a school with $2n$ people. For a set $X$ of students in this school, if any two students in $X$ know each other, we call $X$ well-formed. If the maximum number of students in a well-formed set is no more than $n$, find the maximum number of well-formed set. Here, an empty set and a set with one student is regarded as well-formed as well.