The arena is a flatland dotted with skyscrapers, which your enemies use for cover. You and your enemies shoot each other with lasers. All of you carry jet packs, allowing flight.
Which enemies can you hit with your laser, and which are hiding?
First, the size of an arena is given by an integer
n on a single line. The following
n lines contain
n integers per line separated by a space. Each integer represents the height of the building at that location. Each building is a rectangular solid, 1 unit by 1 unit by height units.
Next, your location is given on a single line as three floating point numbers
Finally, the number of enemies are given by an integer
m on a single line. The following
m lines contain three floating point numbers per line separated by a space. These represent the
z coordinates of an enemy. The coordinate system is defined as follows:
xis measured from left to right in the city input
yis measured from top to bottom
zis measured from the ground up
For each enemy, if an unobstructed line can be drawn from you to that enemy, output a positive integer. Otherwise, output a negative integer. Separate outputs with a new line.
Comments, denoted by '#', are present to help you quickly see what each line does. They will not be present in the actual input.
5 # Size of the map 0 0 0 0 0 # Buildings 0 0 0 0 0 # Buildings 4 4 4 4 4 # Buildings 0 0 0 0 0 # Buildings 0 0 0 0 0 # Buildings 2.5 0.0 4.0 # Your location 3 # Number of enemies 2.5 5.0 0.1 # Enemy location 2.5 5.0 5.0 # Enemy location 0.0 2.7 4.5 # Enemy location
For the sample input above, we output the following:
-1 1 1
- 0 <
- 0 <
- 0 <=
- 0 <=
- 0 <=
- Players will not be located on or inside of a corner, edge, or side of a building
- Your line of sight to an enemy will never be tangent to the corner, edge, or side of a building
- A player is not an obstruction