Ограничения: время – 1s/2s, память – 32MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод
Послать решение Blockly Посылки Темы Где Обсудить (0)
A ground-to-air radar system uses an antenna that rotates
in a horizontal plane with a period of 2 seconds.
Whenever the antenna faces an object, its distance from that antenna
is measured and displayed on a circular screen as a white dot.
The distance from the dot to the centre of the screen
is proportional to the horizontal distance from the antenna to the object,
and the angle of the line passing through the centre and the dot represents
the direction of the object from the antenna. A dot directly above the
centre represents an object that is north of the antenna; an object to
the right of the centre represents an object to the east, and so on.
The antenna rotates clockwise; that is, if it points north (0°) at time `t\ =\ 0.0`,
it points east (90°) at `t\ =\ 0.5`, south (180°) at `t\ =\ 1.0`, west (270°) at `t\ =\ 1.5`,
north at `t\ =\ 2`, and so on. If the object is directly on
top of the radar antenna, it cannot be observed.
There are a number of objects in the sky.
Each is moving at a constant velocity, and appears as a dot on the
screen that appears in a different position every time the antenna observes
it. Your task is to determine where the dot will appear on the screen the
next time the antenna observes it, given the previous two observations. If
there are several possibilities, you are to find them all.
Input
The input consists of a number of lines, each with four real numbers:
`a_1`, `d_1`, `a_2`, `d_2`. `a_1`, `d_1` are the angle (in degrees)
and distance (in arbitrary distance units) for the first observation
while `a_2`, `d_2` are the angle and distance for the second
observation (`0\ ≤\ a_i\ <\ 360`, `0\ <\ d_i\ <\ 1000`).
Output
The output consists of one line per line of input, containing all
posible solutions sorted by ascending angle value and then by descending
distance value; each solution consists of two real numbers
(with two digits after the decimal place) indicating `a_3`, `d_3`, the angle
and distance for the next observation.
Sample Input
90.0 100.0 90.0 110.0
90.0 100.0 270.0 10.0
90.0 100.0 180.0 50.0
Sample Output
90.00 120.00
270.00 230.00
199.93 64.96 223.39 130.49
Source: Waterloo local, 2002