[Solution] Where's the Bishop? Codeforces Solution | Codeforces Problem Solution 2022
Mihai has an chessboard whose rows are numbered from to from top to bottom and whose columns are numbered from to 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 and , 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.
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 () — 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 lines, each containing 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 and () — 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.
No comments:
Post a Comment