251. Polymania
time limit per test: 0.25
sec.
memory limit per test: 65536
KB
input: standard
output: standard
Consider N points on the plane. Each point has its special number. Points arrangement is called "awful" if for any three different points A, B, and C the sum of their special numbers is equal to the area of the triangle ABC.
You are given special numbers for all points, but not their coordinates. You have to find some awful points arrangement.
It is guarantee, that last special number and previous are equal.
Input
The first line of input contains single integer N (3<=N<=8). Next line contains N positive integers R[i]  special numbers of points (0<R[i]<=100, R[N1]=R[N]).
Output
On the first line output "YES" (without quotes) if the solution exists, or "NO" (without quotes) if it does not. In case of positive answer output N lines with points coordinates: X[i] and Y[i] with four digits after the decimal point.
Sample test(s)
Input
Test #1
3
2 3 3
Test #2
4
1 1 1 1
Output
Test #1
YES
1.5000 0.0000
5.5000 0.0000
1.5000 4.0000
Test #2
YES
0.0000 0.0000
0.0000 2.4495
2.4495 0.0000
2.4495 2.4495
Author:  Alexey Preobrajensky

Resource:  Petrozavodsk Summer Training Sessions 2004

Date:  August 25, 2004

Server time: 20171120 23:47:58  Online Contester Team © 2002  2016. All rights reserved. 

