QOJ.ac

QOJ

时间限制: 2.0 s 内存限制: 2048 MB 总分: 100

#16193. 搬运家具

统计

Binary Casino 已经连续不间断地营业了很长一段时间。它急需翻新,因为地毯和家具的严重损坏看起来很不美观。在翻新期间,所有游戏室里的四脚游戏桌都被存放在了储藏室里。

你的任务并不困难。你的老板要求你把游戏桌搬回它们之前摆放的完全相同的位置。每个游戏桌的桌面都是一个正方形,且桌腿正好位于桌面的四个角下方。好消息是,在翻新前游戏桌摆放的地方,地毯上留下了由桌腿压出的小凹坑,并且你知道房间里原本有多少张桌子。另一个好消息是,你的老板不记得桌子具体摆放在哪里了。坏消息是,你的老板知道房间里所有游戏桌的总面积,并坚持要求保持这个数值不变。

你必须利用地毯上的每一个凹坑来放置游戏桌,将每条桌腿放入一个凹坑中。桌子之间不能重叠。

输入格式

输入的第一行包含一个整数 $N$ ($1 \le N \le 3 \cdot 10^3$),表示游戏桌的数量。

接下来有 $4N$ 行,每行包含两个整数 $X$ 和 $Y$ ($-10^9 \le X, Y < 10^9$),代表地毯上一个凹坑的坐标。这些凹坑以任意顺序给出,且任意两个凹坑的坐标都不相同。

输出格式

输出一个数——房间内所有游戏桌的面积之和。如果输出与正确答案的差值不超过 $10^{-3}$,则认为输出是正确的。

样例

输入样例 1

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

输出样例 1

11

输入样例 2

1
0 0
3 4
-1 7
-4 3

输出样例 2

25.0000

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.