407173: GYM102697 144 Triangulation Rocks the Nation

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

144. Triangulation Rocks the Nationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
This problem is worth 35 points.

You have a triangle with three points given in coordinates. Given this information, figure out the triangle's area. The points can be given in any order.

To calculate the area of a triangle, you can use Heron's Formula, which is described below:

Define $$$A$$$, $$$B$$$, and $$$C$$$ to be the lengths of the three sides of the triangle.

Define $$$S$$$ to be equal to $$$\frac{A + B + C}{2}$$$.

Then, the area of the triangle is calculated as $$$\sqrt{S(S - A)(S - B)(S - C)}$$$.

Input

The input consists of three lines, each consisting of two space-separated integers $$$x$$$ and $$$y$$$: the coordinates of each point of the triangle.

Output

Output a single decimal number $$$a$$$: the area of the triangle, using Heron's Formula as described above. Do not round your answer.

ExamplesInput
1 1
5 4
2 8
Output
12.5
Input
0 0
8 0
4 8
Output
32.0
Input
-1 -3
2 7
9 -11
Output
62.0
Note

This triangle corresponds to the first example case:

加入题单

算法标签: