3. In $\triangle A B C$, the sides opposite to $\angle A, \angle B, \angle C$ are $a, b, c$ respectively, and $\tan A=\frac{1}{2}, \cos B=\frac{3 \sqrt{10}}{10}$. If the longest side of $\triangle A B C$ is 1, then the length of the shortest side is ( ).
(A) $\frac{2 \sqrt{5}}{5}$
(B) $\frac{3 \sqrt{5}}{5}$
(C) $\frac{4 \sqrt{5}}{5}$
(D) $\frac{\sqrt{5}}{5}$