South Central USA Regional Programming Contest
|
Boudreaux and Thibodaux have just seen the Matrix, and are arguing whether or not it would actually be possible to dodge bullets if you moved fast enough. Boudreaux is used to hunting nutria with buckshot, and maintains that most bullet spreads should make it impossible to dodge all the bullets. Thibodaux is still doing kung-fu in his head, and is sure that if you could move fast enough it would be possible to dodge the bullets. Boudreaux is getting fed up, and is about ready to prove his point with some empirical testing. Your job is to come up with a way to prove or disprove this hypothesis for different scenarios using computer simulations, which are much safer than the methods that Boudreaux has in mind.
Input
Input to this problem will consist of a (non-empty) series of up to 20 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets.
A single data set has 5 components:
Note:
Output
Find out if the target got out 'da way. A hit occurs when any bullet passes through a grid square with mass in it. For the sake of simplicity, the target can be assumed to be two dimensional, and the bullets volumeless. Also, Boudreaux and Thibideaux don't even know what precision means, they just make sure to calculate to at least four decimal places. (In other words, don't worry about precision edge detection. Just keep the math simple and use very precise numbers to minimize error. You'll find hits in the correct places.)
For each data set, there will be exactly one output set, and there will be exactly one blank line separating output sets.
An output set will take one of two forms:
Sample Input
START 3
-10,-2,1
300,14.5,-20
350,-80,0
400,28.75,26
@@@@ n
#^^# oU
## o
ooooooooooo
o oooooo
o oooo
o DDDD
oo DDDD
D D
D D
TT TT
TT TT
<TTT TTT>
END
START 2
-10,-2,1
300,14.5,-20
350,-80,0
@@@@ n
#^^# oU
## o
ooooooooooo
o oooooo
o oooo
o DDDD
oo DDDD
D D
D D
TT TT
TT TT
<TTT TTT>
END
Sample Output
@@@@ * #^^# oU ## o ooooooooooo o oooooo o oooo o DDDD oo DDDD D D D D TT TT TT TT <TTT TTT> Got out da way!