Little and large

A point moves around inside a rectangle. What are the least and the greatest values of the sum of the squares of the distances from the vertices?

Problem



Image
Little and Large

The point $X$ moves around inside a rectangle of dimension $p$ units by $q$ units. The distances of $X$ from the vertices of the rectangle are $a$, $b$, $c$ and $d$ units. What are the least and the greatest values of

$a^2 + b^2 + c^2 + d^2$

and where is the point $X$ when these values occur?