#include #include using namespace std; typedef struct { int row; int column; } dot; int dr[] = {0, 0, -1, 1}; int dc[] = {1, -1, 0, 0}; int n, m; int graph[500][500] = {-1, }; bool check[500][500] = {false, }; int pictureNum; int picture[250 * 500] = {0, }; int bfs(dot start) { queue q; q.push(start); check[start.row][start.column] = true; int pictureSize = 1; while (!q.empty()) { dot next = q.f..