← 返回题目列表

Codeforces · 1028/A

A. 求正方形

中文机器翻译题面 查看原题

考虑一个大小为 $$$n \times m$$$ 的桌子,最初是全白色的。行从上到下编号为 $$$1$$$ 到 $$$n$$$,列从左到右编号为 $$$1$$$ 到 $$$m$$$。桌子内部一些边长奇数的正方形被漆成黑色。找到这个正方形的中心。

输入

The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 115$$$) — the number of rows and the number of columns in the table.

The $$$i$$$-th of the next $$$n$$$ lines contains a string of $$$m$$$ characters $$$s_{i1} s_{i2} \ldots s_{im}$$$ ($$$s_{ij}$$$ is 'W' for white cells and 'B' for black cells), describing the $$$i$$$-th row of the表。

输出

Output two integers $$$r$$$ and $$$c$$$ ($$$1 \le r \le n$$$, $$$1 \le c \le m$$$) separated by a space — the row and column numbers of the center of the black square.

示例

输入 #1

5 6
WWBBBW
WWBBBW
WWBBBW
WWWWWW
WWWWWW

输出 #1

2 4

输入 #2

3 3
WWW
BWW
WWW

输出 #2

2 1