a-c=5
a^2+b^2+c^2-ab-bc-ca
=1/2(2a^2+2b^2+2c^2-2ab-2bc-2ca)
=1/2((a-b)^2+(b-c)^2+(a-c)^2)
=1/2(9+4+25)
=19