Nexus-6 revolt

ifnextchar ( ifnextchar (offsettrue(0pt,0pt) offsetfalse ifnextchar
[(0pt,0pt)(0pt,0pt) ifnextchar
[(0pt,0pt)(0pt,0pt)[l](0pt,0pt)(0pt,0pt)[l][] [r][image]

Year 2019. Nexus-6, the last generation of replicants, have just
revolted. They are leaded by Roy Batty, a combat model with the
intellect of a genius. Roy is now alone, surrounded by human enemy
forces near the Tannhauser Gates. Fortunately for it (replicants are
machines, so they are neither “he” nor “she”), those humans are not
Blade Runners, but just plain policemen. Therefore, Roy will have no
difficulties eliminating them all with its laser gun.

Roy is located at (0, 0). Initially, Roy’s laser gun is beaming towards
the north, that is, in the (0, 1) direction. When Roy turns its laser
gun (right or left), every human in front of it disappears immediately.
Roy wants to minimize its effort (measured as the number of degrees
turned) while destroying all those insignificant humans. Help it!

Input

Input is all integer numbers with absolute value at most 10⁴, and
consists of several cases. Every case begins with the number of humans
n ≥ 1, followed by n different positions (x, y). No given position is
(0, 0). A special case with n = 0 ends the input.

Output

For every case, print with two digits after the decimal point the
minimum number of degrees that Roy must turn to eliminate all human
forces. The input cases have no precision issues, and the result will
always be strictly positive.

Problem information

Author: Marçal Garolera

Generation: 2026-01-25T11:11:49.581Z

© Jutge.org, 2006–2026.
https://jutge.org
