**1 人解决**，6 人已尝试。

**2 份提交通过**，共有 25 份提交。

**9.9** EMB 奖励。

**单点时限: **2.0 sec

**内存限制: **512 MB

Arty has been an abstract artist since childhood, and his works have taken on many forms. His latest (and most pricey) creations are lovingly referred to as Abstract Art within the abstract art community (they’re not the most original bunch when it comes to loving nicknames). Here’s an example of one of Arty’s recent works:

As you can see, Abstract Art is created by painting (possibly overlapping) polygons. When Arty paints one of his designs he always paints each polygon completely before moving on to the next one.

The price of individual pieces of Arty’s Abstract Art varies greatly based on their aesthetic appeal, but collectors demand two pieces of information about each painting:

- the total amount of paint used, and
- the total amount of canvas covered.

Note that the first value will be larger than the second whenever there is overlap between two or more polygons. Both of these values can be calculated from a list containing the vertices of all the polygons used in the painting, but Arty can’t waste his time on such plebeian pursuits — he has great art to produce! I guess it’s left up to you.

The first line of input contains a single integer () representing the number of polygons to be painted. Following this are lines each describing a painted polygon. Each polygon description starts with an integer () indicating the number of sides in the polygon, followed by pairs of integers ( specifying the coordinates of the vertices of the polygon in consecutive order. Polygons may be concave but no polygon will cross itself. No point on the canvas will be touched by more than two polygon border segments.

Display both the total amount of paint used and the amount of canvas covered. Your answers must have a relative or absolute error of at most .

Input

3 8 7 10 7 17 10 20 17 20 20 17 20 10 17 7 10 7 4 0 0 0 8 8 8 8 0 4 3 3 3 13 13 13 13 3

Output

315.00000000 258.50000000