You have joined a team of software designers building a new air-traffic control system. One of its functions is to automatically verify that the monitored aircraft's instruments are working, and to alert controllers to aircraft that are endangered, newly aloft, or possibly downed. You are to write a prototype of this function.
Your program is given a series of scenarios, each consisting of two radar sweeps. Each sweep detects between $0$ and $100$ airplanes. Every time a sweep encounters a plane, the data-acquisition system captures an azimuth reading and a distance (in miles) from the radar, and also retrieves from the plane a squawk number and a ground speed (in miles/hour, an airspeed with wind corrections). Based on the two sweeps you must decide, for every plane in the radar's domain, whether a warning is required.
Assume a radar range (radius of coverage) of $10$ miles and instantaneous sweeps occurring $5$ seconds apart, so the time between sweeps is $\Delta t = 5/3600$ hours.
An azimuth $\theta$ and distance $d$ can be turned into plane coordinates (only relative positions matter for distances): let $x = d\sin\theta$ and $y = d\cos\theta$.
Based on the radar and plane information, issue the following warnings.
The first line of each scenario contains an integer $N_1$ ($0 \le N_1 \le 100$), the number of planes detected in the first sweep. The next $N_1$ lines each describe exactly one plane detected in sweep 1. Each description contains a squawk number, an azimuth, a distance, and a ground speed. The squawk number is an integer of 1 to 5 digits; the azimuth, distance, and ground speed are real numbers in the format XXX.XXX with leading and trailing zeroes as needed to fill all 6 places.
Immediately after the sweep-1 descriptions is a line with an integer $N_2$ ($0 \le N_2 \le 100$), the number of planes detected in the second sweep, followed by $N_2$ lines describing the sweep-2 planes in the same format.
The next scenario, if any, begins with $N_1$ on the following line. Read and process scenarios until end-of-file.
For each scenario, first print Scenario # X, where $X$ is the scenario number, starting at $1$ for the first scenario and increasing by $1$.
Then, for each plane requiring a warning, print exactly one report line. Sort the report lines in ascending order of squawk number. On each line, write the squawk number right-justified in columns 1 to 5, then starting in column 6 one of the following warning strings (print the leading blanks and dashes exactly as shown):
" -- equipment warning"" -- new intrusion"" -- new aloft"" -- domain exited"" -- domain loss"Print nothing for planes that require no warning.
Separate two consecutive scenarios with a single blank line (there is no extra blank line after the final scenario).