FERMAT 2022 Problem 24

There are functions f(x) with the following properties:

  • f(x)=a x^{2}+b x+c for some integers a, b and c with a>0, and
  • f(p)=f(q)=17 and f(p+q)=47 for some prime numbers p and q with p<q.

For each such function, the value of f(p q) is calculated. The sum of all possible values of f(p q) is S. What are the rightmost two digits of S?