Create a vector to store starting and ending points
for ( int i = 0 ; i < n ; i ++ ) { points [ i * 2 ] = make_pair ( seg [ i ] . first , false ) ; points [ i * 2 + 1 ] = make_pair ( seg [ i ] . second , true ) ; }