QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 128 MB 満点: 10

#6088. 萤火虫

統計

清晨,Bajtazar 舒适地坐在 Bajtockie 湖的码头上,沉浸在他最喜爱的爱好——钓鱼中。某一刻,他注意到平静的湖面上空盘旋着许多萤火虫。这一景象让 Bajtazar 着迷,他决定拍一张照片记录下来。

Bajtazar 的相机拍摄的照片呈正方形。在拍照前,Bajtazar 可以将相机设置在任意高度,并将其向左或向右移动。但他不想旋转相机,以免照片拍歪。相机还配备了变焦功能,用于放大或缩小图像。

Bajtazar 非常希望所有在湖面上空飞行的萤火虫都能出现在照片中。他想通过变焦功能调整照片参数,使昆虫在照片中尽可能大。Bajtazar 愿意等待一段时间,直到它们排列成最理想的拍照位置。

为了简化问题,我们可以假设所有萤火虫始终位于同一个与相机感光元件平面平行的平面内,并且每只萤火虫都以恒定的速度向量运动。

输入格式

输入的第一行包含一个整数 $n$ ($1 \le n \le 100\,000$),表示萤火虫的数量。接下来的 $n$ 行,每行包含四个整数 $x_{i}, y_{i}, a_{i}, b_{i}$ ($-10^{6} \le x_{i}, y_{i}, a_{i}, b_{i} \le 10^{6}$),分别表示第 $i$ 只昆虫的初始位置 $(x_{i}, y_{i})$ 和速度向量 $[a_{i}, b_{i}]$。换句话说,在 $t$ 个时间单位后,第 $i$ 只萤火虫将位于点 $(x_{i} + t \cdot a_{i}, y_{i} + t \cdot b_{i})$。点的坐标是在直角坐标系中给出的,其坐标轴与相机感光元件的边平行。

输出格式

你的程序应输出一行,包含一个非负实数 $d$,表示在某个时间点能够覆盖所有萤火虫的正方形的最小边长,其中正方形的边必须与坐标轴平行。结果与精确值的误差不超过 $10^{-3}$ 即可。

样例

样例输入 1

4
4 0 -1 1
1 6 -1 -2
-1 -5 0 2
-1 -1 1 1

样例输出 1

3.00000000000000000000

说明

图中标记了萤火虫的初始位置以及它们在两个时间单位内经过的路径。图中还标记了一个边长为 3 的正方形,它包含了 $t = 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.