Ограничения: время – 2s/4s, память – 64MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод
Послать решение Blockly Посылки Темы Где Обсудить (2)
It's customary to eat pizza after programming contests, and pepperoni is a beloved choice,
but a slice of pepperoni pizza isn't perfect unless every pepperoni on it is perfectly round. In
this problem, we are given the placement of two round pepperonis on a whole pizza, and must
determine whether it is possible to make a perfect slice – a straight radial slice emanating from the
center of the pizza that avoids cutting either pepperoni, and perfectly bisects the angles emanating
from the center of the pizza between and tangent to each pepperoni.
Input Format
Each line of input describes a pair of round pepperonis on a whole (uncut) pizza. Each
pepperoni is described by two real numbers `x` and `y` giving the Cartesian coordinates `(x,\ y)` of the
center of the pepperoni, and a positive real number `r` giving the radius of the round pepperoni. The
two pepperonis are placed on a whole pizza whose center is at Cartesian coordinate `(0,\ 0)` (and
whose radius is irrelevant).
Output Format
For each pair of pepperonis in the input, determine whether it is possible to make a perfect
slice. If one of the pepperonis covers or touches the center of the pizza, it is not possible to make
a perfect slice. If there is no straight radial slice emanating from the center of the pizza that goes
between the pepperonis without cutting or being tangent to one of them, it is not possible to make
a perfect slice. Otherwise, report two angles in degrees of the perfect slice. The angle of the positive
`x`-axis is considered 0 degrees, with positive angles counterclockwise from there and negative
angles clockwise from there. Slice angles should be reported in increasing order in degrees between `-180` and `180` and accurate to two decimal places.
Sample Input
10 10 5 1 2 3
10 10 1 -10 10 1
19 6 3 7 12 4
5 5 3 8 12 1
10 10 1 0 -10 1
12.2 5.1 3.4 16.1 -3.4 2.9
Sample Output
center covered
slice at -90.00 and 90.00 degrees
slice at -137.33 and 34.60 degrees
no slice between them
slice at -21.66 and 156.66 degrees
slice at -172.24 and 3.01 degrees
Source: California State Polytechnic University Programming Contest, Winter 2009