#99Medium
Triangle perimeter and area
Time: 1 s · Memory: 256 MB
- Functions
Statement
You are given the coordinates of the vertices of a triangle: , , . Find its perimeter and area. Split the solution into functions: Leng — the distance between two points, Perim — the sum of three Leng calls, Area — Heron's formula:
Input format
A single line with six integers (each at most in absolute value). The points do not lie on one line.
Output format
A single line with two numbers: the perimeter and the area, each with exactly 2 digits after the decimal point.
Examples
Input
0 0 3 0 0 4
Output
12.00 6.00
Input
1 1 4 5 -2 3
Output
14.93 9.00
Note
Each function does one job and uses the others: Area gets the sides from Leng. In the first example the sides are : perimeter 12.00, area 6.00.
