309516: CF1692C. Where's the Bishop?

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:3 Solved:0

Description

Where's the Bishop?

题意翻译

## 题目描述 有一个$8\times8$的棋盘,列编号从左到右递增,行编号从上到下递增。 给出一个棋盘,上面用$#$标明了主教的攻击范围。请你找出主教的位置坐标,并输出其行、列编号。 保证:主教的行、列编号均在$2$与$7$之间。 你需要回答$t$组测试数据。 $(1\le t \le 36)$

题目描述

Mihai has an $ 8 \times 8 $ chessboard whose rows are numbered from $ 1 $ to $ 8 $ from top to bottom and whose columns are numbered from $ 1 $ to $ 8 $ 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 $ 2 $ and $ 7 $ , 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. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1692C/a628ab5b17df485b146f85dc0b0977dd4288932f.png)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 $ t $ ( $ 1 \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 $ 8 $ lines, each containing $ 8 $ 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 $ r $ and $ c $ ( $ 2 \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 $ 4 $ and column $ 3 $ , the correct output is 4 3.

Input

题意翻译

## 题目描述 有一个$8\times8$的棋盘,列编号从左到右递增,行编号从上到下递增。 给出一个棋盘,上面用$#$标明了主教的攻击范围。请你找出主教的位置坐标,并输出其行、列编号。 保证:主教的行、列编号均在$2$与$7$之间。 你需要回答$t$组测试数据。 $(1\le t \le 36)$

Output

题目大意:
一个8x8的棋盘上有一个主教,主教不在棋盘边缘(即行和列的编号都在2到7之间,包含2和7)。主教可以沿对角线攻击任意距离,包括它所在的格子。给出一个棋盘,上面用“#”标出了主教的攻击范围,需要找出主教的位置坐标,并输出其行、列编号。题目保证有唯一解。

输入输出数据格式:
输入格式:
- 第一行包含一个整数t(1≤t≤36),表示测试数据的组数。
- 每组测试数据由8行组成,每行包含8个字符。这些字符要么是“#”,表示被攻击的格子;要么是“.”,表示未被攻击的格子。

输出格式:
- 对于每组测试数据,输出两个整数r和c(2≤r, c≤7),分别表示主教的行和列编号。

输入输出样例:
输入样例 #1:
```
3

.....#..
#...#...
.#.#....
..#.....
.#.#....
#...#...
.....#..
......#.

#.#.....
.#......
#.#.....
...#....
....#...
.....#..
......#.
.......#

.#.....#
..#...#.
...#.#..
....#...
...#.#..
..#...#.
.#.....#
#.......
```
输出样例 #1:
```
4 3
2 2
4 5
```题目大意: 一个8x8的棋盘上有一个主教,主教不在棋盘边缘(即行和列的编号都在2到7之间,包含2和7)。主教可以沿对角线攻击任意距离,包括它所在的格子。给出一个棋盘,上面用“#”标出了主教的攻击范围,需要找出主教的位置坐标,并输出其行、列编号。题目保证有唯一解。 输入输出数据格式: 输入格式: - 第一行包含一个整数t(1≤t≤36),表示测试数据的组数。 - 每组测试数据由8行组成,每行包含8个字符。这些字符要么是“#”,表示被攻击的格子;要么是“.”,表示未被攻击的格子。 输出格式: - 对于每组测试数据,输出两个整数r和c(2≤r, c≤7),分别表示主教的行和列编号。 输入输出样例: 输入样例 #1: ``` 3 .....#.. #...#... .#.#.... ..#..... .#.#.... #...#... .....#.. ......#. #.#..... .#...... #.#..... ...#.... ....#... .....#.. ......#. .......# .#.....# ..#...#. ...#.#.. ....#... ...#.#.. ..#...#. .#.....# #....... ``` 输出样例 #1: ``` 4 3 2 2 4 5 ```

加入题单

算法标签: