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:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 4.9.2, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM chicken, SCM guile, SCM qobi, ST, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.