proprietor needs to eliminate a few (perhaps zero) sunflowers to arrive at the accompanying two objectives: At the point when you are on a vacant cell, you can stroll to some other void cell. All in all, those unfilled cells are associated. There is actually one basic way between any two void
Correct answer will be upvoted else downvoted. Computer science.
the proprietor needs to eliminate a few (perhaps zero) sunflowers to arrive at the accompanying two objectives:
At the point when you are on a vacant cell, you can stroll to some other void cell. All in all, those unfilled cells are associated.
There is actually one basic way between any two void cells. All in all, there is no cycle among the vacant cells.
You can stroll from an unfilled cell to another in the event that they share a typical edge.
Could you kindly give the proprietor an answer that meets every one of her prerequisites?
Note that you are not permitted to establish sunflowers. You don't have to limit the number of sunflowers you eliminate. It tends to be shown that the appropriate response consistently exists.
Input
The input comprises of different experiments. The main line contains a solitary integer t (1≤t≤104) — the number of experiments. The portrayal of the experiments follows.
The principal line contains two integers n, m (1≤n,m≤500) — the number of lines and segments.
Every one of the following n lines contains m characters. Each character is either 'X' or '.', addressing an unfilled cell and a cell that grows a sunflower, individually.
It is ensured that the amount of n⋅m for all experiments doesn't surpass 250000.
Output
For each experiment, print n lines. Each ought to contain m characters, addressing one line of the table. Each character ought to be either 'X' or '.', addressing an unfilled cell and a cell with a sunflower, individually.
In case there are numerous replies, you can print any. It very well may be shown that the appropriate response consistently exists.
Step by step
Solved in 4 steps with 1 images