A friend of yours is a paraglider pilot who flies at Tiger Mountain outside of Seattle, WA. The site is popular and, unfortunately, also in the landing approach patterns of some flights heading to Sea-Tac airport or Boeing field. This could obviously lead to dangerous situations involving high- flying paragliders and low-flying jets. Your friend, knowing you're a code guru, has asked for your help in developing an early warning system to let paraglider pilots know when jet traffic might intrude upon their airspace.
You've researched and found a web API that can give you real-time flight data on nearby air traffic, and another that lets you send text messages to the pilots. Now all you have to do is to figure out which flights could cause a problem.
The first input line describes the airspace; it contains five floating point numbers: the (xc, yc) coordinates of the center of the cylinder in feet (-50,000 ≤xc, yc ≤ 50,000), the radius (r) of the cylinder in feet (1 ≤r≤ 10,000), and the lower (l) and upper (u) bounds of the cylinder in feet (0≤l<u≤ 10,000).
The second input line contains a single integer,n(1 ≤n≤ 100), indicating the number of aircraft to process.
The next n input lines describe the incoming aircraft. Each line provides data about an aircraft and contains seven numbers: an integer flight numberf(1,000 ≤f≤ 9,999), the (xa, ya) position of the aircraft (-200,000 ≤xa, ya ≤ 200,000), the heading (h) of the aircraft in degrees (0 ≤h< 360), the altitude (a) in feet (1,000 ≤ a ≤ 35,000), the speed (s) in feet per second (100 ≤ s ≤10,000), and the descent rate (d) in feet per second (0 ≤d≤s). All inputs for the incoming aircraft, other than the flight number, are given in floating point.
Assume that the aircraft will never start inside the cylinder. Also assume that, if an aircraft enters the paragliders' cylinder, it will be within the cylinder at multiple points.
If the aircraft will not enter the cylinder, print the message:
Flightfis safe. wherefis the flight number.
If the aircraft will intersect the cylinder, print the message:
Incoming! Flightfenters att0 and exits att1.
where f is the flight number, t0 is the time in seconds when the aircraft will enter the cylinder, andt1 is the time in seconds when the aircraft will exit the cylinder. Print the times rounded to two decimal places (i.e., the time 0.274 would be printed as 0.27; the time 0.275 would be printed as 0.28). If the aircraft grazes the cylinder (with an error of 10-6), it is considered to have entered and exited.
Aircraft image credit:https://www.norebbo.com/2015/04/bombardier-canadair-regional-jet-200-blank-illustration-templates/