The Picnic
Time limit1sMemory limit128 MB
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 , the number of scenarios.
Each scenario consists of two lines. The first line contains an integer (), the number of obstacles. The second line lists the obstacle coordinates in the order . All coordinates are integers in . 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.