eolymp
bolt
Try our new interface for solving problems
Problems

Cut a triangle

Cut a triangle

Given a triangle. Cut it with a straight line into two shapes so that the areas and perimeters of these two shapes are equal. \InputFile Three rows of two integers each: $x_i$, $y_i$ ($-1000 ≤ x_i, y_i ≤ 1000$) are the coordinates of the vertices of the triangle. It is guaranteed that the triangle is non-degenerate. \OutputFile Two lines of two real numbers are the coordinates of the two points on the border of the triangle, through which the cut should be made. The answer will be counted if each of the two points belongs to at least one side of the triangle, and the two figures obtained by cutting have equal area and equal perimeter. It is considered that a point belongs to a line, if the distance between them is not more than $10^{-8}$. The areas and perimeters of the figures must be equal with an absolute or relative error of $10^{-8}$.
Time limit 2 seconds
Memory limit 256 MiB
Input example #1
0 3
4 0
0 0
Output example #1
0.0000000000000000 1.2247448713915894
3.3797958971132713 0.4651530771650463
Author Olexander Milanin
Source Summer School Sevastopol 2013, Wave 2, Day 3