Consider 2024 distinct prime numbers $p_1, p_2, \dots, p_{2024}$ such that \[p_1+p_2+\dots+p_{1012}=p_{1013}+p_{1014}+\dots+p_{2024}.\]Let $A=p_1p_2\dots p_{1012}$ and $B=p_{1013}p_{1014}\dots p_{2024}$. Prove that $|A-B|\geq 4$.
2024 Spain Mathematical Olympiad
Day 1
Let $n$ be a positive integer. Let $x_1, x_2, \dots, x_n > 1$ be real numbers whose product is $n+1$. Prove that \[\left(\frac{1}{1^2(x_1-1)}+1\right)\left(\frac{1}{2^2(x_2-1)}+1\right)\cdots\left(\frac{1}{n^2(x_n-1)}+1\right)\geq n+1\]and find for which values equality holds.
Let $ABC$ be a scalene triangle and $P$ be an interior point such that $\angle PBA=\angle PCA$. The lines $PB$ and $PC$ intersect the internal and external bisectors of $\angle BAC$ at $Q$ and $R$, respectively. Let $S$ be the point such that $CS$ is parallel to $AQ$ and $BS$ is parallel to $AR$. Prove that $Q$, $R$ and $S$ are colinear.
Day 2
Let $a,b,c,d$ be real numbers satisfying \[abcd=1\quad \text{and}\quad a+\frac1a+b+\frac1b+c+\frac1c+d+\frac1d=0.\]Prove that at least one of the numbers $ab$, $ac$, $ad$ equals $-1$.
Given two points $p_1=(x_1, y_1)$ and $p_2=(x_2, y_2)$ on the plane, denote by $\mathcal{R}(p_1,p_2)$ the rectangle with sides parallel to the coordinate axes and with $p_1$ and $p_2$ as opposite corners, that is, \[\{(x,y)\in \mathbb{R}^2:\min\{x_1, x_2\}\leq x\leq \max\{x_1, x_2\},\min\{y_1, y_2\}\leq y\leq \max\{y_1, y_2\}\}.\]Find the largest value of $k$ for which the following statement is true: for all sets $\mathcal{S}\subset\mathbb{R}^2$ with $|\mathcal{S}|=2024$, there exist two points $p_1, p_2\in\mathcal{S}$ such that $|\mathcal{S}\cap\mathcal{R}(p_1, p_2)|\geq k$.
Let $a$, $b$ and $n$ be positive integers, satisfying that $bn$ divides $an-a+1$. Let $\alpha=a/b$. Prove that, when the numbers $\lfloor\alpha\rfloor,\lfloor2\alpha\rfloor,\dots,\lfloor(n-1)\alpha\rfloor$ are divided by $n$, the residues are $1,2,\dots,n-1$, in some order.