eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків

Polygon

Ліміт часу 1 секунда
Ліміт використання пам'яті 16 MiB

Write a program to find a convex polygon whose sides have the given lengths.

In this task, we consider a polygon to be convex if all its inner angles are strictly greater than 0 degrees and strictly less than 180 degrees.

Вхідні дані

The first line of the file contains an integer N, the number of vertices of the polygon (3N1000). Each of the following N lines contains an integer a_i, the length of one side of the polygon (1a_i10000).

Вихідні дані

If the desired polygon can be constructed, the output file should contain exactly N lines. Each line should contain two real numbers x_i and y_i (|x_i| ≤ 10000000, |y_i| ≤ 10000000) such that by connecting the points (x_i, y_i) and (x_{i+1}, y_{i+1}) for all 1i < N and additionally the points (x_N, y_N) and (x_1, y_1) with line segments, we obtain a convex polygon. The lengths of the line segments must be equal to the numbers given in the input file, but not necessarily in the same order.

The vertices of the constructed polygon can be listed either clockwise or counterclockwise.

If the polygon cannot be constructed, print NO SOLUTION on the single line of the output file.

Приклад

Вхідні дані #1
4
7
4
5
4
Вихідні дані #1
0.5 2.5
7.5 2.5
4.5 6.5
0.5 6.5
Джерело BOI-2005