0091. Five Points

Имя входного файла: 5points.in
Имя выходного файла: 5points.out
Ограничение по времени: 2 s
Ограничение по памяти: 64 megabytes

Merlin has chosen five points in space and measured pairwise distances between them. After that he provided these distances to Arthur. Now Arthur wonders whether Merlin has deceived him. Help him to find it out.

Input file

The input file contains ten real numbers which are distances between the points given in arbitrary order. These numbers differ from exact values by no more than 10-12.

Output file

If the numbers given can be distances described, output YES. Then output five lines with possible coordinates of these points.

If the numbers can't be distances, output a single line with word NO.

Examples:

5points.in5points.out
1 1 1 1 2 2 2 3 3 4YES 0 0 0 0 0 1 0 0 2 0 0 3 0 0 4


Источник: Petrozavodsk Winter 2003. Final Contest, Saturday, February 08

Обсудить       Отправить решение



Версия для печати