Protecting SheepProblem code: PRTCTSHP |
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.
Input Format
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.
Output Format
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.
Example
Input:
5
0.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0
0.5 0.5
Output:
12.0
| Author: | singh_sume |
| Date Added: | 12-01-2012 |
| Time Limit: | 9 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments

Fetching successful submissions

The fence should be a
crazysaikat: No, Useless
What is maximal number of
I don't think the test data
@vikhyat : Till how many
dj3500: i'm looking into it,
Can u please explain how the
given cordinates are sheep's
loonydmad: the sheep's; it
dj3500 and everyone else: the
soumyaukil: try plotting the
limits on p (number of
"each of the sheep is inside
can you give some more test
aseem_pandey: each sheep is
deepak_nitk:
u guys should have clearly
mprateek: It _is_ mentioned
what will output for : (0.0,
mkagenius: no, 208.0
shud the fence be such that
dr_go_fast: Yes, it will be