Save the coordinates of the given vertices of the rectangle
if ( s [ i ] [ j ] == ' * ' ) { row [ i ] ++ ; col [ j ] ++ ; } int x , y ; for ( auto tm : row ) if ( tm . second == 1 ) x = tm . first ; for ( auto tm : col ) if ( tm . second == 1 ) y = tm . first ;