CF1692C.Where's the Bishop?

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Mihai has an 8×88 \times 8 chessboard whose rows are numbered from 11 to 88 from top to bottom and whose columns are numbered from 11 to 88 from left to right.

Mihai has placed exactly one bishop on the chessboard. The bishop is not placed on the edges of the board. (In other words, the row and column of the bishop are between 22 and 77 , inclusive.)

The bishop attacks in all directions diagonally, and there is no limit to the distance which the bishop can attack. Note that the cell on which the bishop is placed is also considered attacked.

An example of a bishop on a chessboard. The squares it attacks are marked in red.Mihai has marked all squares the bishop attacks, but forgot where the bishop was! Help Mihai find the position of the bishop.

输入格式

The first line of the input contains a single integer tt ( 1t361 \leq t \leq 36 ) — the number of test cases. The description of test cases follows. There is an empty line before each test case.

Each test case consists of 88 lines, each containing 88 characters. Each of these characters is either '#' or '.', denoting a square under attack and a square not under attack, respectively.

输出格式

For each test case, output two integers rr and cc ( 2r,c72 \leq r, c \leq 7 ) — the row and column of the bishop.

The input is generated in such a way that there is always exactly one possible location of the bishop that is not on the edge of the board.

输入输出样例

  • 输入#1

    3
    
    .....#..
    #...#...
    .#.#....
    ..#.....
    .#.#....
    #...#...
    .....#..
    ......#.
    
    #.#.....
    .#......
    #.#.....
    ...#....
    ....#...
    .....#..
    ......#.
    .......#
    
    .#.....#
    ..#...#.
    ...#.#..
    ....#...
    ...#.#..
    ..#...#.
    .#.....#
    #.......

    输出#1

    4 3
    2 2
    4 5

说明/提示

The first test case is pictured in the statement. Since the bishop lies in the intersection row 44 and column 33 , the correct output is 4 3.

首页