Traverse each pair of coordinates
for ( int i = 0 ; i < n * 4 + 1 ; ++ i ) { int x1 = ( int ) 2e9 , x2 = ( int ) - 2e9 ; int y1 = ( int ) 2e9 , y2 = ( int ) - 2e9 ; for ( int j = 0 ; j < n * 4 + 1 ; ++ j ) if ( i != j ) {