QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 2048 MB 總分: 100

#3993. 司法管辖区祛魅

统计

超凡者与冠军联盟(SLPC)一直在监视一名腐败政客窃取选举的阴谋。在过去的一周里,该政客使用了一种精神控制技术,奴役了负责选出选举获胜者的 $n$ 名代表。幸运的是,SLPC 已经成功招募了你,因此你可以利用你的力量打破精神控制。你可以在一个轴对齐矩形区域内打破精神控制。不幸的是,你的力量代价高昂;第二天你会感到头痛,头痛程度与矩形的面积成正比。你甚至不想冒险或去想如果你在一天内多次使用你的力量会发生什么。

你已经完成了研究,并且知道每位代表在投票即将开始时所站的位置。你需要解放足够多的代表,以防止该政客获得多数(严格大于二分之一)选票。为了做到这一点,你能影响的最小轴对齐矩形的面积是多少?

输入格式

输入的第一行包含一个整数 $T$ ($1 \le T \le 10$),表示测试用例的数量。每个测试用例的第一行包含一个整数 $n$ ($1 \le n \le 299$,$n$ 为奇数),表示代表的人数。接下来的 $n$ 行,每行包含两个整数,表示一位代表的 $x$ 和 $y$ 坐标。保证所有坐标都在 $-10,000$ 到 $+10,000$ 之间。

输出格式

对于每个测试用例,输出一行,包含包含超过 $n/2$ 名代表的最小轴对齐矩形的面积。

样例

样例输入 1

2
1
1 1
3
0 0
1 4
3 2

样例输出 1

0
4

说明

在第一个案例中,包含单个点的矩形面积为 0。

在第二个案例中,矩形需要包含至少两个点。存在两个最小的可能矩形;一个包含 $(0, 0)$ 和 $(1, 4)$,另一个包含 $(1, 4)$ 和 $(3, 2)$。无论哪种情况,面积均为 4。

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.