Convex Quadrilateral
Time limit9sMemory limit512 MB
Given n points, find the smallest-area convex quadrilateral whose four sides each pass through at least two of the points and that contains every point.
- Level
Hard8 of 10
- Topics
- Geometry, Greedy, Sorting, Brute force
- Solved
- No attempts yet
Problem
You are given points on the plane, , , ..., . Write a program that finds the smallest area of a quadrilateral satisfying all of the following conditions.
- Each of the four sides of passes through at least two of the given points.
- is convex.
- Every given point lies inside or on the boundary of .
- Among all quadrilaterals that satisfy conditions 1 to 3, has the smallest area.
Several quadrilaterals can reach that smallest area, but the value of the smallest area is unique. Report that value.
Input
The first line contains the number of data sets . The data sets follow.
The first line of each data set contains the number of points . Each of the next lines contains the coordinate and the coordinate of the th point, separated by a space.
Constraints
- Coordinates are given with at most two digits after the decimal point.
- The points are distinct.
Output
Print one line for each data set. If a quadrilateral satisfying the conditions exists, print its minimum area rounded to exactly six digits after the decimal point. Otherwise print none.
Every answer stays far enough from a rounding boundary, so the sixth digit is determined.