QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 1024 MB Points totaux : 100

#2692. 猕猴桃树

Statistiques

你准备在你的大地产内种植两棵优质猕猴桃树。你担心树枝会生长到地产边界之外,从而引起邻居的抱怨。你还必须避免将两棵树种得太近,以免它们的树枝长到一起,因为这可能导致果实减产。

树木销售商保证,没有任何树枝或叶子会超出其树干 4 米的范围,因此我们将树木建模为半径为 4 米的圆。树干是完全垂直的。

当地政府法规禁止某些形状的地产。特别地,为了方便政府工作人员绘制和处理该地区的地图,每块地产必须满足以下属性:

  1. 边界是一个简单多边形,即各边不相交并形成一条闭合路径。
  2. 地产的每一条边长至少为 30 米。
  3. 地产任意两条相邻边之间的夹角必须至少为 18 度(平角的 10%),且至多为 144 度(平角的 80%,或者说正十边形的内角)。

只要相邻边的夹角遵循上述规则 3,就允许非凸地产存在,因此顶点处的内角也可以在 $360 - 144 = 216$ 度到 $360 - 18 = 342$ 度之间。参见图 K.1 示例。

图 K.1:样例输入 1 及样例输出 1 中给出的解的示意图。所有标记的角度均至少为 18 度且至多为 144 度。

你的地产遵循这些规则。你能在地产内种植两棵树,使得它们的树枝和叶子不会超出边界,且每棵树的树枝和叶子不会长到另一棵树中吗?

输入格式

输入包含: 一行包含一个整数 $n$,其中 $3 \le n \le 2\,000$,表示描述你地产的多边形的顶点数。 $n$ 行,每行描述一个顶点。每行包含两个整数 $x$ 和 $y$,其中 $0 \le x, y \le 10^7$。这两个数字表示多边形中一个顶点的 $x$ 和 $y$ 坐标(单位为毫米),按它们在多边形中出现的顺时针顺序给出。

此外,多边形的每一条边至少为 30 米(30,000 毫米),且顶点处两条线段的夹角至少为 18 度,至多为 144 度。该多边形是不相交的闭合多边形,即最后一个顶点与第一个顶点相连。

输出格式

如果可以在不让树枝超出地产边界或长入对方树木的情况下种植两棵树,则输出两行,每行包含两个实数 $x$ 和 $y$,给出可以种植树木的两个点的坐标(单位为毫米)。

否则,输出 “impossible”。

你可以假设将半径增加或减少 1 毫米不会改变是否可以种植树木的结果。如果树木位置距离边界至少 3999 毫米,且彼此距离至少 $2 \cdot 3999$ 毫米,你的答案将被接受。

样例

样例输入 1

4
0 3000
29000 38000
56000 0
28000 14000

样例输出 1

32266.13633130 18219.22050526
24266.13633130 18219.22050526

样例输入 2

3
50000 50000
69500 73000
99000 80000

样例输出 2

impossible

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.