UVa 10065

From Algorithmist

Jump to: navigation, search

Contents

[edit] 10065 - Useless Tile Packers

[edit] Summary

This is a straightforward Convex Hull question.

[edit] Explanation

The area wasted is defined in the questions as the area not covered by the points but by the convex hull. So just apply the convex hull algorithm (choose one of them) and calculate the area of the convex hull and call it Ac. Calculate the area that the points cover and call it A.

The percentage of wasted space is given by \frac{A - A_c}{A_c} * 100%

[edit] Input

5
0 0
2 0
2 2
1 1
0 2
5
0 0
0 2
1 3
2 2
2 0
0

[edit] Output

Tile #1
Wasted Space = 25.00 %

Tile #2
Wasted Space = 0.00 %
Personal tools