eolymp
bolt
Try our new interface for solving problems
Problems

Watershed

Watershed

Time limit 3 seconds
Memory limit 64 MiB

Given a map of the rivers of the continent. Each river is shown as a broken line, which starts at the source of the river and ends, or at the point where the river empties into another, or estuary. Lamanov tops - or turning point of the river, or tributary confluence points.

We will consider the basin as a convex polygon of minimum area that contains the river and all its tributaries.

Note: According to this definition, the river basin is the same area may belong to different basins of the rivers.

Example: Displaying the continent with three rivers. The coordinates of the rivers and the basin are given in the table.

Required to find the maximum area of the river basin, located on this continent.

Input data

The first line contains the number of rivers, N. The next line contains N blocks, describing a river. Each unit number i is:

  • A single line with k_i - number of vertices Lamani, describing the river;

  • k_i lines containing a pair of real numbers x_j and y_j (1jk_i), separated by a space - the coordinates of points describing a river.

1N10, the amount of k_i1000, -1000x_j, y_j1000.

Output data

Derive a single number - the area of greatest river basin with two characters after the decimal point.

Examples

Input example #1
3
5
6 9
5 11
3 12
2 10
1 7
3
7 9
5 7
5 5.5
6
3 10
5 8
4 6
5 5.5
6 5
3 5
Output example #1
16.00