18.78 $P$ is a point inside a square with side length $a$, and $P$ is equidistant from the two endpoints of one side of the square and from the opposite side. If $d$ represents this equal distance, then $d$ is equal to
(A) $\frac{3 a}{5}$.
(B) $\frac{5 a}{8}$.
(C) $\frac{3 a}{8}$.
(D) $\frac{\sqrt{2} a}{2}$.
(E) $\frac{a}{2}$.
(14th American High School Mathematics Examination, 1963)
[Solution] Draw $P F \perp C D$ at $F$, then in $\mathrm{Rt} \triangle P D F$, by the Pythagorean theorem we have
$$
\left(\frac{a}{2}\right)^{2}+(a-d)^{2}=d^{2},
$$

Solving this gives $d=\frac{5 a}{8}$.
Therefore, the answer is $(B)$.