CF1028A.Find Square

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Consider a table of size n×mn \times m , initially fully white. Rows are numbered 11 through nn from top to bottom, columns 11 through mm from left to right. Some square inside the table with odd side length was painted black. Find the center of this square.

输入格式

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

The ii -th of the next nn lines contains a string of mm characters si1si2sims_{i1} s_{i2} \ldots s_{im} ( sijs_{ij} is 'W' for white cells and 'B' for black cells), describing the ii -th row of the table.

输出格式

Output two integers rr and cc ( 1rn1 \le r \le n , 1cm1 \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
    
首页