eolymp
bolt
Try our new interface for solving problems
Problems

Divide an Island!

Divide an Island!

A desert island Robinson Crusoe and his companion Friday live on has a shape of a non-degenerate triangle which vertices are points (\textbf{x_1}, \textbf{y_1}), (\textbf{x_2}, \textbf{y_2}), (\textbf{x_3}, \textbf{y_3}). Once Robinson and Friday fell aboard and decided to divide the island into two equal parts by choosing two points on the island coast and connecting them with a line segment. These parts were to have the same area and shore length. Robinson failed to choose these points. Can you do it for him? \InputFile The only line of the input contains space-separated integers \textbf{x_1}, \textbf{y_1}, \textbf{x_2}, \textbf{y_2}, \textbf{x_3}, \textbf{y_3}, not exceeding \textbf{2000} in absolute value. \OutputFile If there is a line segment \textbf{ST}, which divides the island into two parts of the same area and shore length, output \textbf{YES }on the first line of the output, \textbf{S} coordinates on the second line, and \textbf{T} coordinates of the third line. \textbf{S} and \textbf{T} should be located on the island shore. Coordinates should be accurate within \textbf{10^\{-9\}}. If there is no such line segment, output \textbf{NO} on a single line.
Time limit 1 second
Memory limit 64 MiB
Input example #1
0 0
-1 4
4 0
Output example #1
YES
0.98647259197775305000 0.00000000000000000000
0.68162964989824637000 2.65469628008140290000
Author Vladislav Isenbaev
Source USU Junior Contest, October 2008