First pair is correct. Good for you. I found an elementary solution of this problem, I don't use the fact that a – b is a divisor of P(a) – P(b) when a, b are integers and P is a polynomial with integer coefficients.
Denote by j and m the ages of John and Maria. Conditions are:
f(m) = 0
f(7) = 77
f(j) = 85
m > j > 7
First, if p(a)=b then polynomial p is of the form p(x) = (a-x)q(x)+b, q is polynomial too. Special case, when r is root of polynomial p, then p(x)=(m-x)q(x).
Now, m is root of the polynomial f, and we have:
f(x) = (m-x)u(x) , u(x) is integer coefficient polynomial. Let x=7,
f(7) = (m-7)u(7)
77 = (m-7)u(7)
(m-7) | 77 (*)
Let x=j,
f(j) = (m - j)u(j)
85 = (m - j)u(j)
(m - j) | 85 (**)
But, we know that f(7) = 77. We have another form of f:
f(x) = (x - 7)v(x) + 77 , v(x) is integer coefficient polynomial.
Let x=j,
f(j) = (j - 7)v(j) +77
85 = (j - 7)v(j) + 77
8 = (j - 7)v(j)
(j - 7) | 8 (***)
We conclude:
Because of (*), m € {14,18,84}
Because of (***), j € {8,9,11,15}
Easy to see that is m-j € {3,5,6,7,9,10,69,73,74,76}. Number 5 is only one divisor of 85 (condition **), m = 14 , j = 9
The polynomial must have been of the form (x-7)(x-9)(x-14)Q(x) - 3x^2 + 52x -140.
Thanks for your time.