QOJ.ac

QOJ

时间限制: 1.0 s 内存限制: 32 MB 总分: 70

#17062. 食蚁兽

统计

考古学家最近发现了古希腊罗马建筑的遗迹。该遗址可以建模为一个由 $R \times C$ 个正方形网格组成的网格。对于每个网格,考古学家已经确定了那里曾经是否存在建筑物,或者该网格是否一直为空。

在对文物进行详细研究后,他们得出结论:该遗址包含两栋来自不同时期的建筑物,且两栋建筑物的平面图均为正方形。

由于这两栋建筑物属于不同的历史时期,它们的平面图可能会发生重叠。

确定每栋建筑物可能的位置和大小(即平面图所占正方形的边长)。

输入格式

第一行包含两个整数 $R$ ($1 \le R \le 100$) 和 $C$ ($1 \le C \le 100$),表示遗址的大小。

接下来的 $R$ 行,每行包含一个长度为 $C$ 的字符串,由字符 .x 组成。字符 . 表示该网格中没有发现任何东西,而 x 表示该网格中曾经有建筑物。

输出格式

对于这两栋建筑物中的每一栋,在单行中输出其左上角的行号和列号,以及建筑物的大小(边长)。

说明

测试数据保证总是存在解,尽管解可能不唯一。

样例

输入样例 1

3 3
xx.
xxx
...

输出样例 1

1 1 2
2 3 1

输入样例 2

4 6
xx....
xx.xxx
...xxx
...xxx

输出样例 2

1 1 2
2 4 3

输入样例 3

5 5
.....
xxx..
xxxx.
xxxx.
.xxx.

输出样例 3

2 1 3
3 2 3

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.