Task DescriptionDiscussion (0)
Task :: z-nails
There are N nails on the Z's wooden door. You have to but two rubber bands around the nails, so that all the nails are inside one of the two rubber bands, and the total area inside the two rubber bands is minimized.
INPUT:
From the first line of the standard input read one integer N, 2 <= N <= 1000. From each of the next N lines read two integers x and y representing the x and y coordinate of the corresponding nail. All the coordinates will be between 0 and 1000000.
From the first line of the standard input read one integer N, 2 <= N <= 1000. From each of the next N lines read two integers x and y representing the x and y coordinate of the corresponding nail. All the coordinates will be between 0 and 1000000.
OUTPUT:
To the standard output write one real number with two decimal point precision, representing the minimal possible area of the two rubber bands such that they cover all the nails.
To the standard output write one real number with two decimal point precision, representing the minimal possible area of the two rubber bands such that they cover all the nails.
Input:
Output:
6
0 0
0 2
1 1
100 0
100 2
101 1
0 0
0 2
1 1
100 0
100 2
101 1
Output:
2.00
Input:
Output:
In this case we cover the nails (0,0) and (1,1) with the first rubber band, and (100,100) and (200,200) with the second. Both areas are 0 (since they are lines)
4
0 0
1 1
100 100
200 200
0 0
1 1
100 100
200 200
Output:
0.00
In this case we cover the nails (0,0) and (1,1) with the first rubber band, and (100,100) and (200,200) with the second. Both areas are 0 (since they are lines)
Submit Solution
Home
Training
Competitions
Forum
FAQ