五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

CF 1692C - Where's the Bishop?

2023-06-17 10:11 作者:您是打尖兒還是住店呢  | 我要投稿

Mihai has an 8×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.

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.

Input

The first line of the input contains a single integer t (1≤t≤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.

Output

For each test case, output two integers r and c (2≤r,c≤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.

3

.....#..

#...#...

.#.#....

..#.....

.#.#....

#...#...

.....#..

......#.

#.#.....

.#......

#.#.....

...#....

....#...

.....#..

......#.

.......#

.#.....#

..#...#.

...#.#..

....#...

...#.#..

..#...#.

.#.....#

#.......

output

Copy

4 3 2 2 4 5

Note

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.

判斷bishop在哪里,只要這個(gè)位置是#并且左上跟左下都是#,這個(gè)位置就是了,

依次遍歷返回即可;

下面是代碼:


CF 1692C - Where's the Bishop?的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
茌平县| 河北省| 平塘县| 高碑店市| 松潘县| 平陆县| 禹城市| 民权县| 紫金县| 平湖市| 盱眙县| 禹州市| 镇宁| 舟曲县| 白玉县| 田林县| 上犹县| 利川市| 济南市| 开封市| 翼城县| 崇信县| 德州市| 岑巩县| 武宁县| 通州市| 辽阳县| 资源县| 沭阳县| 新巴尔虎左旗| 星座| 宣恩县| 巩留县| 上饶县| 肇源县| 清原| 灵宝市| 姚安县| 二连浩特市| 武隆县| 桃园市|