#abc269b. B - Rectangle Detection
B - Rectangle Detection
Score : points
问题描述
高桥按照以下方式生成了10个字符串。
- 首先,令
..........
(一行连续的10个.
)。 - 接着,选择四个整数、、和,满足所有以下条件。
- 。
- 。
- 然后,对于满足所有以下条件的每一对整数,将的第个字符替换为
#
。- 。
- 。
已知按照上述方式生成的。找出高桥选择的整数、、和。 根据约束条件,可以证明这样的整数、、和唯一存在(答案只有一个)。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Takahashi generated strings as follows.
- First, let
..........
(.
s in a row). - Next, choose four integers , , , and satisfying all of the following.
- .
- .
- Then, for every pair of integers satisfying all of the following, replace the -th character of with
#
.- .
- .
You are given generated as above. Find the integers , , , and Takahashi chose.
It can be proved that such integers , , , and uniquely exist (there is just one answer) under the Constraints.
Constraints
- are strings, each of length , that can be generated according to the Problem Statement.
Input
The input is given from Standard Input in the following format:
Output
Print the answer in the following format:
Sample Input 1
..........
..........
..........
..........
...######.
...######.
...######.
...######.
..........
..........
Sample Output 1
5 8
4 9
Here, Takahashi chose , , , .
This choice generates strings , each of length , where the -th through -th characters of are #
, and the other characters are .
.
These are equal to the strings given in the input.
Sample Input 2
..........
..#.......
..........
..........
..........
..........
..........
..........
..........
..........
Sample Output 2
2 2
3 3
Sample Input 3
##########
##########
##########
##########
##########
##########
##########
##########
##########
##########
Sample Output 3
1 10
1 10
update @ 2024/3/10 11:20:41