All submissions for this problem are available.
A number of traffic cones have been placed on a circular racetrack to form
an obstacle course. You are asked to determine the largest sized car that can
navigate the course. For simplicity, the cones are assumed to have zero width
and the car is perfectly circular and infinitely maneuverable. The track itself
is the area between 2 concentric circles.
Formally, the course can be navigated by a car of radius c if there exists a
closed loop around the center of the track which lies between the circles forming the track, and
every point on the loop is at least c distance away from each cone and each
boundary of the track.
Input begins with an integer T (about 25), the number of test cases.
Each test case begins with 2 integers r and R (1<=r<R<=25000). The racetrack is
the area between the circles centered at (0,0) with radii r and R.
The next line of input contains an integer N (0<=N<=500), the number of cones.
N lines follow, each containing the coordinates of a cone. The coordinates are
integers, and are guaranteed to lie within the track, and be distinct.
Cases are separated by a blank line.
For each input, output on a single line the diameter of the largest car that
can navigate the course, rounded to 3 decimal places.
1 5 10 3 6 0 5 7 -2 -7
The image below shows the course corresponding to the sample input. The black circles represent the boundaries of the racetrack, the small dots the cones, and the filled red circle the car. Also shown is one possible path of the car through the course.
|Tags||aug10, easy, pieguy|
|Time Limit:||0.103333 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.