Problem

Source: Singapore Math Olympiad 2017 2nd Round SMO, Junior p2, Senior p1

Tags: diophantine, Diophantine equation, number theory, factorial



Let $n$ be a positive integer and $a_1,a_2,...,a_{2n}$ be $2n$ distinct integers. Given that the equation $|x-a_1| |x-a_2| ... |x-a_{2n}| =(n!)^2$ has an integer solution $x = m$, find $m$ in terms of $a_1,a_2,...,a_{2n}$