4. A natural number $q$, if any two digits are taken, and the left digit is greater than the right digit, then this number is said to have one inversion. Use $N X(q)$ to denote the number of inversions in $q$ (for example, $N X(3214)=3, N X(12344)=0$). Then the remainder when $N X$ (324 167 895) is divided by 4 is ( ).
(A) 0
(B) 1
(C) 2
(D) 3
4. A.
$$
\begin{array}{l}
N X(324167895)=N X(32416785)+1 \\
=N X(32415)+4=N X(3241)+4=4+4=8 .
\end{array}
$$