line segment covering problem

Given n segments of line (into the $X$ axis) with coordinates $[li; ri]$. You are to choose the minimum number of segments that cover the segment $[0;M]$. All segment are within $[0,M]$.

-
Same question at stackoverflow: stackoverflow.com/questions/3908139/… –  Aryabhata Oct 11 '10 at 16:50