Solution
= Solution
The function
$$
d_D(x)=\min_{y\in D}\frac12\|y-x\|^2
$$
is the <Moreau envelope> of the convex indicator $I_D$, and is therefore convex. It is nonnegative and vanishes exactly on $D$. Since $C\cap D\ne\varnothing$, the minimum of $d_D$ over $C$ is zero, and every minimizer belongs to both $C$ and $D$.