A desert island Robinson Crusoe and his companion Friday live on has a shape of a non-degenerate triangle
which vertices are points (x1, y1),
(x2, y2), (x3, y3).
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?
Input
The only line of the input contains space-separated integers x1, y1, x2,
y2, x3, y3, not exceeding 2000 in absolute value.
Output
If there is a line segment ST, which divides the island into two parts of the same area and shore length, output “YES” on the first line of the output, S coordinates on the second line, and T coordinates of the third line. S and T should be located on the island shore. Coordinates should be accurate within 10−9. If there is no such line segment, output “NO” on a single line.
Samples
input | output |
---|
0 0 10 0 0 10
| YES
0 0
5 5
|
0 3 4 0 3 4
| YES
1.741248277008306 3.580416092336102
3.445803840397070 0.415647119702198
|
Problem Author: Vladislav Isenbaev (prepared by Alexander Ipatov)
Problem Source: USU Junior Contest, October 2008