Problem

Source: Malaysia IMO national selection test 2020

Tags: algebra, quadratic equation



Let $p$ and $q$ be real numbers such that the quadratic equation $x^2 + px + q = 0$ has two distinct real solutions $x_1$ and $x_2$. Suppose $|x_1-x_2|=1$, $|p-q|=1$. Prove that $p, q, x_1, x_2$ are all integers.