Copyright © University of Cambridge. All rights reserved.
'Janusz Asked' printed from https://nrich.maths.org/
For $y = ax + b$, if you can use the given conditions and write $b$
in terms of $a$, then for any value of $a$ there will be a linear
function with this property.
For the second part use the formula relating the sum of the roots
and the coefficients and then work systematically to consider all
cases.