Please subscribe to the official Codeforces channel in Telegram via the link ×

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.

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[N-1]=R[N]).

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)

Test #1
2 3 3

Test #2
1 1 1 1

Test #1
1.5000 0.0000
5.5000 0.0000
1.5000 4.0000

Test #2
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