Write a program that receives the vertices of a triangle \ (T_1 \). Starting from \ (T_1 \) we can define a triangle \ (T_2 \) using as vertices the midpoints of the edges of the triangle \ (T_1 \). The program should print the area and perimeter of the triangles \ (T_1 \) and \ (T_2 \). Each answer must be rounded to 2 decimal places. Entry Three pairs of real numbers. Each line will have a pair of numbers x, y separated by a space that represent a vertex of the triangle at position (x, y). Both numbers will satisfy that \ (0 \ le x, y \ le 10 \). Departure Four real numbers, all separated by a line break. Corresponding to the perimeter of the triangle \ (T_1 \), the area of the triangle \ (T_1 \), the perimeter of the
python problem
Problem statement
Write a
Entry
Three pairs of real numbers. Each line will have a pair of numbers x, y separated by a space that represent a vertex of the triangle at position (x, y). Both numbers will satisfy that \ (0 \ le x, y \ le 10 \).
Departure
Four real numbers, all separated by a line break. Corresponding to the perimeter of the triangle \ (T_1 \), the area of the triangle \ (T_1 \), the perimeter of the triangle \ (T_2 \) and the area of the triangle \ (T_2 \). Respectively.
Examples
Input Example 1
5.32 7.63
9.95 0.89
9.61 5.43
Output Example 1
17.55
9.36
8.78
2.34
Input Example 2
5.21 9.07
9.29 3.2
9.17 6.89
Output Example 2
15.36
7.18
7.68
1.79
Step by step
Solved in 2 steps