QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 256 MB 總分: 100

#17443. 多边形

统计

编写一个程序,寻找一个边长为给定长度的凸多边形。

在本题中,如果一个多边形的所有内角都严格大于 $0$ 度且严格小于 $180$ 度,则认为该多边形是凸的。

输入格式

第一行包含一个整数 $N$,表示多边形的顶点数($3 \le N \le 1000$)。

接下来的 $N$ 行,每行包含一个整数 $a_i$,表示多边形的一条边长($1 \le a_i \le 10\,000$)。

输出格式

如果可以构造出满足条件的多边形,输出应包含恰好 $N$ 行。每行包含两个实数 $x_i$ 和 $y_i$($|x_i| \le 10\,000\,000$,$|y_i| \le 10\,000\,000$),使得通过线段依次连接点 $(x_i, y_i)$ 和 $(x_{i+1}, y_{i+1})$(对于所有 $1 \le i < N$),以及连接点 $(x_N, y_N)$ 和 $(x_1, y_1)$,可以得到一个凸多边形。这些线段的长度必须与输入中给出的边长相等,但顺序不一定相同。

构造出的多边形顶点可以按顺时针或逆时针顺序给出。

如果无法构造出这样的多边形,则在单行中输出 NO SOLUTION

样例

输入样例 1

4
7
4
5
4

输出样例 1

0.5 2.5
7.5 2.5
4.5 6.5
0.5 6.5

评分

评分程序在判断两长度是否相等时,允许小于 $0.001$ 的误差。

接受任何标准的浮点数格式。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.