CSG-CPC
Online Judge

1027 : Perimeter of Triangles

         Time Limit: 1 Sec     Memory Limit: 128 MB     Submitted: 94     Solved: 35    

Description

Calculate the perimeter of the triangle surrounded by three lines.

Input

There are multiple test cases.

In each test case, three straight lines are described by two points on them respectively.

Each point is represented by its coordinates (x, y).

In other words, each test case is described by six point coordinates, that is, twelve numbers.

All the coordinates are integers and in range [0, 10000].

It is guaranteed that the three straight lines of each test case will not be parallel or overlapped.

Output

Output the perimeter of the triangle corresponding to each test case.

The result should be accurated to three decimal places.

Sample

0 0 0 3
0 0 4 0
0 3 4 0
1 0 3 0
1 1 3 3
0 4 4 0
12.000
9.657

Hint

Author

CSGrandeur