欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1512B.Almost Rectangle
Almost Rectangle
There is a square field of size in which two cells are marked. These cells can be in the same row or column.
You are to mark two more cells so that they are the corners of a rectangle with sides parallel to the coordinate axes.
For example, if and a rectangular field looks like this (there are asterisks in the marked cells):
$$$ \begin{matrix} . & . & * & . \\ . & . & . & . \\ * & . & . & . \\ . & . & . & . \\ \end{matrix}$$</p><p>Then you can mark two more cells as follows</p><p>$$\begin{matrix} * & . & * & . \\ . & . & . & . \\ * & . & * & . \\ . & . & . & . \\ \end{matrix}$$$If there are several possible solutions, then print any of them.
Input
The first line contains a single integer (). Then test cases follow.
The first row of each test case contains a single integer () — the number of rows and columns in the table.
The following lines each contain characters '.' or '\*' denoting empty and marked cells, respectively.
It is guaranteed that the sums of for all test cases do not exceed .
It is guaranteed that there are exactly two asterisks on the field. They can be in the same row/column.
It is guaranteed that the solution exists.
Output
For each test case, output rows of characters — a field with four asterisks marked corresponding to the statements. If there multiple correct answers, print any of them.
Samples
6
4
..*.
....
*...
....
2
*.
.*
2
.*
.*
3
*.*
...
...
5
.....
..*..
.....
.*...
.....
4
....
....
*...
*...
*.*.
....
*.*.
....
**
**
**
**
*.*
*.*
...
.....
.**..
.....
.**..
.....
....
....
**..
**..
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |