5. In Rt $\triangle A B C$, the hypotenuse $c=5$, the two legs $a \leqslant 3, b \geqslant 3$, then the maximum value of $a+b$ is ( ).
(A) $5 \sqrt{2}$
(B) 7
(C) $4 \sqrt{3}$
(D) 6
5. B

Translate the text above into English, please retain the original text's line breaks and format, and output the translation result directly.