ZOJ Problem Set - 1328
You have been hired to a team of software designers to write a new air- traffic control system. One of the functions of this new software is to automatically verify the functioning of the subject aircrafts' instrumentation and alert controllers to endangered, newly aloft, or possibly downed aircraft. You are to write a prototype of this function.
Your program will be given a series of scenarios which include 2 radar sweeps each. Each radar sweep will find 0 to 100 airplanes. Each time a sweep encounters a plane, the data acquisition system captures an azimuth reading and distance (in miles) from the radar. It will also retrieve (from the plane) a squawk number and a ground speed in miles/hour (actually an airspeed with wind corrections). Based on the two radar sweeps, your program is to determine if a warning is required for any plane in the radar's domain.
You should assume a radar range (radius of the area covered) of 10 miles and instantaneous sweeps that occur 5 seconds apart.
Based on the information about the radar and planes, you are to determine if the controllers should be warned of potential problems.
An ``equipment warning" is issued if the average of the plane's two indicated airspeeds is not within 10% of the airspeed measured/calculated based on radar sweeps.
A ``new intrusion" warning is issued if the second radar sweep indicates a plane which was not present in the first sweep, but whose indicated airspeed + 10% is sufficient to have brought the plane onto the scope (on the shortest path) between the two sweeps. If the speed is not sufficient to account for a plane which was already aloft, then the assumption must be made that there is a ``new aloft" warning to be issued because a plane has just taken off within the domain of the radar.
A ``domain exited" warning is issued if the first sweep of the radar indicates a plane which is not seen in the second sweep but whose indicated airspeed + 10% is sufficient to have accounted for the plane leaving the range of the radar (on the shortest path) within the two sweeps. If the speed is not sufficient to allow the plane to leave the radar scope between the sweeps, a ``domain loss" warning is issued indicating that the plane has either landed or crashed with the controller's domain.
Immediately following the lines with the descriptions of planes in the first sweep is a line with a single integer (0 <= N2 <= 100) indicating the number of planes detected in the second sweep. The next N2 lines each contain the description of exactly one detected plane in sweep 2.
The next scenario (if any) starts with N1 on the next line. You are to read and process scenarios to the end-of-file.
After each scenario, print a blank line.
Scenario # 1
Source: South Central USA 1995