Presently the proprietor needs to eliminate a few (perhaps zero) sunflowers to arrive at the accompanying two objectives:    At the point when you are on an unfilled cell, you can stroll to some other void cell. As such, those unfilled cells are associated.    There is actually one straightforward way between any

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Correct answer will be upvoted else downvoted. Computer science.

 

 Presently the proprietor needs to eliminate a few (perhaps zero) sunflowers to arrive at the accompanying two objectives: 

 

At the point when you are on an unfilled cell, you can stroll to some other void cell. As such, those unfilled cells are associated. 

 

There is actually one straightforward way between any two void cells. All in all, there is no cycle among the unfilled cells. 

 

You can stroll from an unfilled cell to another in the event that they share a typical edge. 

 

Could you if it's not too much trouble, give the proprietor an answer that meets every one of her necessities? 

 

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 primary 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 a vacant cell and a cell that grows a sunflower, separately. 

 

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.

 

 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Intelligent Machines
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education