#include #include using namespace std; const int DUZO = 999999; char orig[20][20]; char tab[20][20]; int R, C; int res; void mark( int x, int y ) { if ( x < 0 or x >= R or y < 0 or y >= C ) return; if ( tab[x][y] == 'X' ) tab[x][y] = '.'; else tab[x][y] = 'X'; } void strzel( int x, int y ) { // printf("strzelam w %d %d\n", x, y); mark( x, y ); mark( x-1, y ); mark( x+1, y ); mark( x, y-1 ); mark( x, y+1 ); } int fun() { scanf("%d %d", &R, &C); if ( R == 0 or C == 0 ) return 1; res = DUZO; for ( int i = 0; i < R; i++ ) { for ( int j = 0; j < C; j++ ) { scanf(" %c", &orig[i][j]); } } for ( int l = 0; l < (1<