Answered step by step
Verified Expert Solution
Link Copied!

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 N\times N at T =1(1st 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 testdata.in file. On the first line, there Is an integer T the number of test cases. Each test case will be given 2 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 1 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 1), and followed by N lines, the configuration of field after M seconds. You should give a blank line after each test case.
Constraints
1<= T <=100
1<= N, M <=100
Sample Input (testdata.in)
3
31
###
###
F##
32
###
###
F##
33
###
###
F##
Sample Output (standard output)
Case #1:
###
###
F##
Case #2:
###
FF#
FF#
Case #3:
FFF
FFF
FFF

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

What do you need to know about motivation to solve these problems?

Answered: 1 week ago