Polycarp find n segment street a segment index describe integer l_i r_i coordinate begin end segment respectively Polycarp realize do not need segment want delete thempolycarp believe set k segment good segment l_i r_i 1 leq leq k set intersect segment set intersection point segment for example set 3 segment 1 4 2 3 3 6 good segment 2 3 intersect segment set Set 4 segment 1 2 2 3 3 5 4 5 goodpolycarp wonder minimum number segment delete remain segment form good set