QOJ.ac

QOJ

時間限制: 3.0 s 記憶體限制: 512 MB 總分: 100

#8620. 拼图

统计

对于一张 $1 \times 1$ 的正方形纸片,最多进行 20 次以下操作:在正方形内均匀随机选取两个点,并作一条经过这两点的直线。

随后,纸片沿所有直线被切割成 $n$ 个碎片。接着,这些碎片被随机旋转(但不翻转)、平移,并交给你。你需要还原每个碎片的初始位置。

输入格式

第一行包含一个整数 $n$ ($2 \le n$),表示碎片的数量。接下来是碎片的描述。 每个碎片的描述以一个整数 $m$ ($3 \le m$) 开头,表示顶点的数量。接下来的 $m$ 行,每行包含两个实数 $x_i$ 和 $y_i$ ($0.0 \le x_i, y_i \le 2.0$),保留小数点后 12 位。 顶点按逆时针顺序给出。

输出格式

你需要按输入中给出的顺序输出碎片。 对于每个碎片,按输入中给出的顺序输出顶点的坐标。每个坐标必须满足条件 $0.0 \le x_i, y_i \le 1.0$。 如果存在多种将碎片放入 $1 \times 1$ 正方形内且互不重叠的方法,你可以输出其中任意一种。 如果任意两个多边形的重叠面积大于 $10^{-6}$,则答案将被视为错误。

样例

输入 1

4
4
0.440405375916 0.778474079786
0.000000000000 0.090337001520
0.469097990019 0.000000000000
0.702887505082 0.689470121906
4
0.222810526978 0.000000000000
0.270828246634 0.522212063829
0.000000000000 0.547114887265
0.021480010612 0.069880870008
4
0.000000000000 0.312825941471
0.358219176380 0.000000000000
0.532830100286 0.122181578260
0.088431750275 0.414089758021
4
0.158867722074 0.061734605990
0.973532298476 0.000000000000
0.853551564066 0.712811281737
0.000000000000 0.569141075980

输出 1

0.277161636 -0.000000000
0.473262431 0.793116645
0.000000000 0.728029248
0.000000000 0.000000000
0.524415047 1.000000000
0.000000000 1.000000000
0.000000000 0.728029248
0.473262431 0.793116645
1.000000000 1.000000000
0.524415047 1.000000000
0.473262431 0.793116645
1.000000000 0.865558433
0.473262431 0.793116645
0.277161636 -0.000000000
1.000000000 -0.000000000
1.000000000 0.865558433

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.