QOJ.ac

QOJ

حد الوقت: 2.0 s حد الذاكرة: 1024 MB مجموع النقاط: 100 قابلة للهجوم ✓

#7081. 切割平面

الإحصائيات

平面上有 $n$ 个不同的点,其中任意三点都不共线。

你需要使用 $\lceil \frac{n}{2} \rceil$ 条不经过任何给定点的直线来切割平面,使得任意两个给定点都不在同一个区域内。

输入格式

输入包含多组测试数据。第一行包含一个整数 $T$,表示测试数据的组数。对于每组测试数据:

第一行包含一个整数 $n$ ($1 \le n \le 100$),表示点的数量。

接下来的 $n$ 行,每行包含两个整数 $x$ 和 $y$ ($-1000 \le x, y \le 1000$),描述平面上的一个点。

保证每组测试数据都有解,且所有测试数据的 $n$ 之和不超过 $10^5$。

输出格式

对于每组测试数据,输出 $\lceil \frac{n}{2} \rceil$ 行来描述一个解。

每行包含四个整数 $x_1, y_1, x_2$ 和 $y_2$,表示一条经过 $(x_1, y_1)$ 和 $(x_2, y_2)$ 的直线,其中 $(x_1, y_1) \neq (x_2, y_2)$,且每个坐标的绝对值不超过 $10^9$。

样例

输入 1

2
3
0 0
2 1
4 0
4
0 1
1 0
2 1
1 2

输出 1

1 0 1 1
3 0 3 1
0 0 2 2
2 0 0 2

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.