4. Polynomial
$$
\begin{array}{l}
|x+1|+|x-2|+|x+3|+\cdots+ \\
|x+2007|+|x-2008|+|x+2009|
\end{array}
$$

The minimum value of the above expression is ( ).
(A) 2019044
(B) 2017035
(C) 2009
(D) 0
4. A.
$$
\begin{array}{l} 
| x+ 1|+| x-2|+| x+3 |+\cdots+ \\
|x+2007|+|x-2008|+|x+2009| \\
=|x+1|+(|x-2|+|x+3|)+\cdots+ \\
(|x-2008|+|x+2009|) \\
\geqslant|x+1|+|(x-2)-(x+3)|+\cdots+ \\
|(x-2008)-(x+2009)| \\
=|x+1|+2+3+\cdots+2009 \\
\geqslant 0+2+3+\cdots+2009 \\
= \frac{2009 \times 2010}{2}-1 \\
= 2019044 .
\end{array}
$$

The equality holds if and only if \( x = -1 \).