1485. Polygon

单点时限: 2.0 sec

内存限制: 256 MB

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 input contains an integer N, the number of vertices of the polygon (3 <= N <= 1000). Each of the following N lines contains an integer ai, the length of one side of the polygon (1 <= ai <= 10,000).

输出格式

If the desired polygon can be constructed, the output should contain exactly N lines. Each line should contain two real numbers xi and yi (|xi| <= 10,000,000, |yi| <= 10,000,000) such that by connecting the points (xi, yi) and (xi+1, yi+1) for all 1 <= i < N and additionally the points (xN, yN) and (x1, y1) with line segments, we obtain a convex polygon. The lengths of the line segments must be equal to the numbers given in the input, 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.

样例

Input
4
7
4
5
4
Output
0.5 2.5
7.5 2.5
4.5 6.5
0.5 6.5

0 人解决,5 人已尝试。

0 份提交通过,共有 8 份提交。

9.9 EMB 奖励。

创建: 17 年,3 月前.

修改: 7 年,2 月前.

最后提交: 3 年,10 月前.

来源: BOI 2005

题目标签