This page is still under construction.

Parts of this page are still being built. What you see may change.

Convex Quadrilateral

Time limit9sMemory limit512 MB

Summary
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 nn points on the plane, (x1,y1)(x_1, y_1), (x2,y2)(x_2, y_2), ..., (xn,yn)(x_n, y_n). Write a program that finds the smallest area of a quadrilateral QQ satisfying all of the following conditions.

  1. Each of the four sides of QQ passes through at least two of the given points.
  2. QQ is convex.
  3. Every given point lies inside QQ or on the boundary of QQ.
  4. Among all quadrilaterals that satisfy conditions 1 to 3, QQ 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 TT. The TT data sets follow.

The first line of each data set contains the number of points nn. Each of the next nn lines contains the xx coordinate and the yy coordinate of the iith point, separated by a space.

Constraints

  • 1≤T≤601 \le T \le 60
  • 1≤n≤3001 \le n \le 300
  • ∣xi∣,∣yi∣≤1000.00|x_i|, |y_i| \le 1000.00
  • 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.

Examples2

  1. Example 1

    Input
    2
    9
    0 1
    1 0
    1 3
    1 5
    3 1
    3 3
    5 0
    5 2
    6 4
    4
    -1 -1
    5 -1
    0 0
    -1 51
    
    Expected output
    23.625000
    none
    
  2. Example 2

    Input
    3
    4
    0 0
    4 0
    4 4
    0 4
    4
    0 0
    10 0
    0 10
    1 1
    5
    0 0
    4 0
    5 3
    2 5
    -1 3
    
    Expected output
    16.000000
    none
    29.250000