Minimal Segment Cover

CodeForces - 1175E