Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lili is observing a field of grass on fire. A field sized N times N at T = 1 ( 1 st second )
Lili is observing a field of grass on fire. A field sized Ntimes N at T st second has a Spot on fire indicated with character F For every second passed everything around the Fire got burned as well. Help Lili draw the field after M seconds.
Format Input
The input will consist of several lines of input in testdatain file. On the first line, there Is an integer T the number of test cases. Each test case will be given integers: N the Field size and M the number of seconds. The next N line is a field of grass with the Character # as the grass and the character F as the fire. There is only character F At the beginning. There is also a blank line after each test case.
Format Output
Output should be expressed in format Case#X:
X is the number of the test case starting from and followed by N lines, the configuration of field after M seconds. You should give a blank line after each test case.
Constraints
T
N M
Sample Input testdatain
###
###
F##
###
###
F##
###
###
F##
Sample Output standard output
Case #:
###
###
F##
Case #:
###
FF#
FF#
Case #:
FFF
FFF
FFF
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started