#P6711. [BalticOI 2005] Polygon (Day2)

    ID: 5675 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>计算几何2005二分Special JudgeBalticOI

[BalticOI 2005] Polygon (Day2)

Description

Given the length of each edge of a convex hull, construct this convex hull.

Input Format

The first line contains an integer NN, representing the number of points.

The next NN lines each contain an integer aia_i, representing the length of one edge. Here, ai (i<n)a_i\ (i<n) is the length of the edge between the ii-th point and the (i+1)(i+1)-th point, and ai (i=n)a_i\ (i=n) is the length of the edge between the nn-th point and the 11-st point.

Output Format

Output NN lines. Each line contains two real numbers xi,yix_i, y_i, representing the coordinates of a point. (They must satisfy xi,yi107|x_i|, |y_i| \le 10^7.)

If there are multiple solutions, output any one of them.

If there is no solution, output NO SOLUTION.

Requirements for judging on Luogu

Note: please output the points on the convex hull in counterclockwise order.

Although the original statement allows either clockwise or counterclockwise order, in this problem you must output strictly in counterclockwise order.

You do not have to output in the original numbering order. For example, if P1P2P3P_1 \to P_2 \to P_3 is counterclockwise, then P2P3P1P_2 \to P_3 \to P_1 is also acceptable.

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

Hint

Sample Explanation

For sample 11:

Constraints

For 100%100\% of the testdata, 3N10003 \le N \le 1000, 1ai1041 \le a_i \le 10^4.

This problem uses Special Judge.

Thanks to the spj author

https://www.luogu.com.cn/user/60864

Notes

Translated from BalticOI 2005 Day2 C Polygon.

Translated by ChatGPT 5