All submissions for this problem are available.
Useless Fencing Inc. has recently scored a contract to create a fence around a bunch of sheep in light of recent wolf attacks. As implied by their name, Useless Fencing tries to use as little fencing material as possible.
In order to determine the location of each of the sheep, Useless Fencers has deployed a system consisting of laser range-finders. This has given them the location of each of the sheep, however because of errors inherent in the system, they only know that each of the sheep is inside a square of side 2 units. (Note that the orientation of all of these squares is identical, and the coordinate system has been selected so that each of the sides are parallel to one of the axes.)
The sheep are rather lazy (they never move), but none of them should be left outside the fence. Your task is to determine the minimum possible length of the fence.
The first line contains a single integer p representing the number of sheep. This line is followed by p lines each containing two non-negative floats which correspond to the cartesian coordinates of each of the sheep.
You should output a single line containing the length of the fence required. Your answer will be a floating point number, the judge will ignore FP rounding up to 10-6.
5 0.0 0.0 0.0 1.0 1.0 0.0 1.0 1.0 0.5 0.5
|Time Limit:||1.04533 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, HASK, SCALA, 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, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions