x, bgn.y);
            vector<vector<char>> tmaze = maze;
            int mxlen                  = 0;
            point now                  = {0, 0, 0};
            // while (que.size() > loadcnt) {
            while (!que.empty()) {
                now = que.front();
                que.pop();
                // printf("  now: %d, %d\n", now.x, now.y);
                rep(i, 0, 4) {
                    point next = {now.x + mx[i], now.y + my[i], now.dp + 1};
                    if (next.x >= 0 && next.x < w && next.y >= 0 && next.y < h) {
                        // if (maze[next.x][next.y] == '.') {
                        if (tmaze[next.x][next.y] == '.') {
                            // printf("    push: %d, %d\n", next.x, next.y);
                            tmaze[next.x][next.y] = 'x';
                            que.push(next);
                        }
                    }
                }

                mxlen = max(mxlen, now.dp);
            }
            mxmxlen = max(mxmxlen, mxlen);
        }
    }

    cout << mxmxlen << endl;

    return 0;
}
