6. Given $m, n \in \mathbf{Z}$, and $1 \leqslant m \leqslant 99,1 \leqslant n \leqslant 99$, then the number of ordered pairs $(m, n)$ such that $(m+n)^{2}+3 m+n$ is a perfect square is ( ) .
A. 98
B. 100
C. 96
D. 99