Problem

Source: INAMO 2023 P8 (OSN 2023)

Tags: algebra, polynomial, quadratic equation, quadratics, maximization, Indonesia



Let $a, b, c$ be three distinct positive integers. Define $S(a, b, c)$ as the set of all rational roots of $px^2 + qx + r = 0$ for every permutation $(p, q, r)$ of $(a, b, c)$. For example, $S(1, 2, 3) = \{ -1, -2, -1/2 \}$ because the equation $x^2+3x+2$ has roots $-1$ and $-2$, the equation $2x^2+3x+1=0$ has roots $-1$ and $-1/2$, and for all the other permutations of $(1, 2, 3)$, the quadratic equations formed don't have any rational roots. Determine the maximum number of elements in $S(a, b, c)$.