2024 DMC Mock 10 Problems/Problem 8

Note the identity $a^2+b^2+c^2-ab-ba-ca=\frac{(a-b)^2+(b-c)^2+(c-a)^2}{2}$. Substituting in the values, we see that the expression is $\frac{3^2+4^2+7^2}{2}=\boxed{37}$. Alternatively, notice that the expression is 2$\pmod{5}$, so the answer must be $\boxed{B}$.