ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

1281. River Basin

Time limit: 1.0 second
Memory limit: 64 MB
Problem illustration
You are given a map of rivers of some continent. Every river is shown as a broken line, which begins with a river head and ends either at the point where the river flows into another one, or on the river mouth. The vertexes of the broken line are the turning points of the river-bed, or the points of tributary flow.
We will consider the river basin as a convex polygon of minimum area that contains the river and all its tributaries.
Remark. According to the definition of river basin the same territory may belong to the basins of different rivers.
Sample. A continent with three rivers is shown. The coordinates of the rivers and areas of the basins are given in the table.
River nameXYBasin area
river16912
511
312
17
river2791.5
57
55.5
river33109.5
58
46
55.5
65
35
Your task is to calculate the maximum among all river basin areas.

Input

The first line contains the number of the rivers N. The rest of the input contains N blocks describing the rivers.
Each block i consists of:
  • One line which contains ki – the number of the points in river description;
  • ki lines containing pairs of real numbers xj and yj (1 <= j <= ki), separated by space characters – the coordinates of the points that describe the river-bed.
Limitations.
0 < N <= 10, ∑ki <= 1000, -1000 <= xj, yj <= 1000.

Output

contains one number – the area of the largest basin calculated with two digit precision.

Samples

inputoutput
3
4
6 9
5 11
3 12
1 7
3
7 9
5 7
5 5.5
6
3 10
5 8
4 6
5 5.5
6 5
3 5
16.00
2
4
6 9
5 11
3 12
1 7
6
3 10
5 8
4 6
5 5.5
6 5
3 5
12.00
Problem Author: © Sergey G. Volchenkov, 2003(volchenkov@yandex.ru); Vladimir N. Pinaev, 2003(vpinaev@mail.ru; http://www.pic200x.chat.ru); Michael Y. Kopachev, 2003 (mkopachev@krista.ru).
Problem Source: 2003-2004 ACM Central Region of Russia Quarterfinal Programming Contest, Rybinsk, October 15-16, 2003