For the given triangle $ABC$, prove that a point $X$ on the side $AB$ satisfies the condition $\overrightarrow{XA} \cdot\overrightarrow{XB} +\overrightarrow{XC} \cdot \overrightarrow{XC} = \overrightarrow{CA} \cdot \overrightarrow{CB} $, iff $X$ is the basepoint of the altitude or median of the triangle $ABC$.
Problem
Source: 1999 Estonia National Olympiad Final Round grade 11 p3
Tags: Vectors, altitudes, median, geometry