QOJ.ac

QOJ

Time Limit: 6.4 s Memory Limit: 1024 MB Total points: 100

#8505. 几乎对齐

Statistics

一场流星雨即将到来!作为一名热情的摄影爱好者,你想要拍摄一张包含所有流星的照片。不仅如此,你还想拍出最好的照片。你知道照片的面积越小,照片就越好。但是,为了捕捉到所有的流星,照片的面积最小能达到多少呢?

你可以拍摄相机视野中任何矩形区域的照片,但不能旋转相机。也就是说,你的照片可以是任何轴对齐矩形。挑战在于:流星在不断移动。设 $t$ 为流星雨开始后经过的秒数。你的目标是找到一个非负的 $t$ 值,使得你可以用尽可能小的矩形捕捉到每一颗流星。照片可以捕捉矩形内的所有流星,包括边界上的流星。

输入格式

第一行包含一个整数 $N$ ($1 \le N \le 10^6$),表示流星的数量。

接下来的 $N$ 行,每行描述一颗流星,包含四个整数 $X, Y, V_X$ 和 $V_Y$ ($-10^9 \le X, Y, V_X, V_Y \le 10^9$),表示在你的相机视野中流星的位置和速度。这意味着在任何时间 $t \ge 0$ 时,流星的坐标为 $(X + t \cdot V_X, Y + t \cdot V_Y)$。如果 $t < 0$,则流星的位置未定义。

输出格式

输出一行,表示在 $t \ge 0$ 时包含所有流星的轴对齐矩形的最小面积。输出的绝对误差或相对误差不得超过 $10^{-9}$。

样例

输入 1

4
0 0 10 10
0 0 10 10
10 10 -10 -10
10 0 -20 0

输出 1

22.222222222222222

输入 2

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

输出 2

0.000000000000000

输入 3

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

输出 3

4.000000000000000

输入 4

1
0 0 0 0

输出 4

0.000000000000000

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.