UVa 11096

From Algorithmist
Jump to navigation Jump to search

11096 - Nails[edit]

Summary[edit]

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

Explanation[edit]

Find the convex hull and calculate its perimeter.

Gotchas[edit]

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[edit]

2
2 4
0 0
0 1
1 0
1 1

5 4
0 0
0 1
1 0
1 1

Output[edit]

4.00000
5.00000