3. $x, y$ are the two real roots of the equation $t^{2}-2 a t+a+6=0$, the minimum value of $(x-1)^{2}+(y-1)^{2}$ is ( ).
A. $-\frac{49}{4}$
B. 18
C. 8
D. does not exist
3. C.
$$
\begin{array}{l}
\Delta=4 a^{2}-4(a+6) \geqslant 0, \text { so } a \leqslant-3 \text { or } a \geqslant 2 \text {. Also, } x+y=2 a, x y=a+6, \text { then } \\
\begin{aligned}
(x-1)^{2}+(y-1)^{2} & =x^{2}+y^{2}-2(x+y)+2=(x+y)^{2}-2 x y-2(x+y)+2 \\
& =4 a^{2}-6 a-10 .
\end{aligned}
\end{array}
$$