URI Online Judge | 1982

New Computers

By Gabriel Duarte, UNIFESO BR Brazil

Timelimit: 1

Has just arrived new supercomputers for computer science labs. The Course staff are very busy and the machines are very heavy, so require a lot of time and several employees to take them from a place.

Figure 1: The dots represent the computers and how they are arranged in the tank.

The Course staff need to isolate the machines with a security tape in order to prevent any trouble. As in Serra everything is very expensive, they need to buy the least amount of tape to pass around computers. Due to the weight of supermachines they will just take a back tape on the machines that are on the edges, without remove any computer of place.

Figure 2: The red line is how the computers has to be isolated.

You as a very enthusiastic student with the machines, will help the tape purchase, telling them the least amount of tape to buy to isolate all computers.


The input consists of several test cases. Each test case begins with an integer N (3 ≤ N ≤ 2000) then have N rows, each containing two integers X and Y (-2000 ≤ X, Y ≤ 2000) indicating the coordinates of each supercomputer within the deposit. The input ends with N = 0 and should not be processed.


For each test case you should print: "Tera que comprar uma fita de tamanho x.", Where x is the total of tape required to cover all computers, with two decimal places.

Input Sample Output Sample

0 8
1 6
8 7
6 6
8 0
3 1
1 1
1 4
2 3
4 4
4 1

Tera que comprar uma fita de tamanho 27.78.
Tera que comprar uma fita de tamanho 12.00.