UVa 11096 - Nails

Summary
Find the length of an elastic band around a set of nails on a 2-D surface.

Explanation
Find the convex hull and calculate its perimeter.

Gotchas
The initial length of the elastic is given; remember that it might be longer than the convex perimeter. Also remember to output in the correct format (to five decimal places). Also, calculations do not fit a 32-bit integer.

Input
2 2 4 0 0 0 1 1 0 1 1

5 4 0 0 0 1 1 0 1 1

Output
4.00000 5.00000