SCU 2010 warmup contest 5

H: Visible Segments