Geometry of Triangles

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Every polygon can be constructed by joining triangles. In particular, we can do this iteratively: we start with a triangle, we add a second triangle identifying one of its sides to one of the sides of the initial triangle, we add a third triangle identifying one of its sides to one of the free sides of one of the original triangles, and so on. We will only consider polygons that can be constructed in this way, where each added triangle touches (and is identified with) exactly one side of a previously positioned triangle.

Given a polygon PP, let TT be the set of triangles used to form it. The sides of each triangle are line segments. Let LL be the set of segments that are sides of some triangle in TT. Note that each element of LL is one side of one or two elements of TT.

Once we have a polygon positioned in the plane, in some cases we can remove some of the triangles that compose it, without changing the set LL. We want to remove triangles so that the set LL is maintained and the total area of the remaining triangles is minimal. Equivalently, we want to select a subset SS of triangles from TT such that:

  1. Every element of LL is the side of at least one triangle in SS; and
  2. 2. The sum of the areas of the elements of SS is as small as possible.

입력

The first line of the input contains an integer NN, 1N1051 ≤ N ≤ 10^5 corresponding to the number of triangles in the triangulation of PP. Each of the following NN lines contains 66 numbers, x_1x\_1, y_1y\_1, x_2x\_2, y_2y\_2, x_3x\_3 and y_3y\_3, indicating the existence of a triangle with coordinates (x_1,y_1)(x\_1, y\_1), (x_2,y_2)(x\_2, y\_2) and (x_3,y_3)(x\_3, y\_3). The triangles are given in arbitrary order. All coordinates will be integers with absolute value at most 10610^6.

출력

Print the minimum area possible, respecting the conditions of the problem, with exactly one decimal place.

힌트

In the figure above , the triangulations T_1=a,b,c,dT\_1 = \\{a, b, c, d\\} and T_2=a,b,cT\_2 = \\{a, b, c\\} represent, respectively, the first and second examples. Note how S_1=a,c,dS\_1 = \\{a, c, d\\} is a valid subset for the first case. Triangle bb is left out, but all of its sides are present in the selected triangles.