3. Let $x, y$ be positive integers no greater than 9, the remainder of $x$ divided by 3 is $f(x)$, and the remainder of $y$ divided by 4 is $g(y)$. If $f(x)+2 g(y)=0$, then the value of $x+2 y$ is ( ).
(A) 11
(B) 22
(C) 25
(D) 27
3. (C).

According to the problem, we have
$$
f(x)=\left\{\begin{array}{l}
0, x=3,6,9, \\
1, x=1,4,7, \\
2, x=2,5,8 .
\end{array} \quad g(y)=\left\{\begin{array}{l}
0, y=4,8, \\
1, y=1,5,9, \\
2, y=2,6, \\
3, y=3,7 .
\end{array}\right.\right.
$$

Since $f(x)$ and $g(y)$ are both non-negative, to make $f(x) + 2g(y) = 0$, it must be that $f(x) = 0$ and $g(y) = 0$. At this time, $x = 3, 6, 9$, and $y = 4, 8$. The maximum values of $x$ and $y$ are 9 and 8, respectively, so the maximum value of $x + 2y$ is $9 + 2 \times 8 = 25$.