This page is still under construction.

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

The Picnic

Time limit1sMemory limit128 MB

Summary
Given up to 99 points, find the largest convex polygon whose vertices are points and whose interior contains no other point.
Level

Hard8 of 10

Topics
Geometry, Dynamic programming, Sorting, Brute force
Solved
No attempts yet

Problem

The company's annual picnic takes place tomorrow in Gloomwood park. The organizer wants a spot where everyone can see everyone else, so the chosen area must be convex: the straight segment between any two points of the area lies entirely inside it.

The park is full of opaque obstacles (large trees, rocks, and so on) that block the view. Each obstacle is treated as a single point of zero size. The area is marked out by stretching a ribbon around some of the obstacles, so every corner of the area is an obstacle. For everyone to see everyone else, no obstacle may lie strictly inside the chosen area (an obstacle on the boundary is allowed).

Among all convex polygons whose corners are obstacles and that enclose no obstacle in their interior, find the one with the largest area.

The park seen from above: black dots are obstacles and the dashed line is the picnic area.

Input

The first line contains a positive integer nn, the number of scenarios.

Each scenario consists of two lines. The first line contains an integer mm (2<m<1002 < m < 100), the number of obstacles. The second line lists the obstacle coordinates in the order x1 y1 x2 y2 … xm ymx_1\ y_1\ x_2\ y_2\ \dots\ x_m\ y_m. All coordinates are integers in [0,1000][0, 1000]. In every scenario at least three obstacles are not collinear, and no two obstacles have the same coordinates.

Output

For each scenario, print one line with the area of the largest convex polygon whose corners are obstacles and that encloses no obstacle, printed with exactly one digit after the decimal point.

Examples4

  1. Example 1

    Input
    1
    11
    3 3 8 4 12 2 22 3 23 5 24 7 27 12 18 12 13 13 6 10 9 6
    
    Expected output
    129.0
    
  2. Example 2

    Input
    1
    3
    0 0 4 0 0 3
    
    Expected output
    6.0
    
  3. Example 3

    Input
    1
    5
    0 0 10 0 10 10 0 10 5 5
    
    Expected output
    50.0
    
  4. Example 4

    Input
    1
    5
    0 0 2 0 4 0 4 4 0 4
    
    Expected output
    16.0