0091. Five Points
Input file name: | 5points.in |
Output file name: | 5points.out |
Time limit: | 2 s |
Memory limit: | 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.in | 5points.out |
---|---|
1 1 1 1 2 2 2 3 3 4 | YES 0 0 0 0 0 1 0 0 2 0 0 3 0 0 4 |
Source: Petrozavodsk Winter 2003. Final Contest, Saturday, February 08
Discuss Submit a solution
Printable version