#P15115. [ICPC 2024 LAC] Almost Aligned

[ICPC 2024 LAC] Almost Aligned

题目描述

A meteor shower is about to happen! As the enthusiastic astronomy photographer that you are, you want to take a single picture of all the meteors that will be part of the phenomenon. Not only that, you want to take the best possible picture. You know that the smaller the area of the photo, the better the picture. But how small can you make the photo to capture them all?

You can take a picture of any rectangular region of your camera’s view, but you cannot rotate the camera. That is, your photo can be any axis-aligned rectangle. The challenge? The meteors are constantly moving. Think of time (tt) as the number of seconds that have passed since the start of the meteor shower. Your goal is to find a non-negative value of tt at which you can capture every single meteor with the smallest possible rectangle. A photo captures all the meteors within the rectangle, including those on the border.

输入格式

The first line contains an integer NN (1N1061 \le N \le 10^6) indicating the number of meteors.

Each of the next NN lines describes a meteor with four integers X,Y,VXX, Y, V_X and VYV_Y (109X,Y,VX,VY109-10^9 \le X, Y, V_X, V_Y \le 10^9), representing the location and velocity of the meteor, as seen by your camera. This means that at any time t0t \ge 0 the coordinates of the meteor are (X+tVX,Y+tVY)(X + t \cdot V_X, Y + t \cdot V_Y). If t<0t < 0 the location of the meteor is undefined.

输出格式

Output a single line with the minimum area of an axis-aligned rectangle containing all the meteors at a time t0t \ge 0. The output must have an absolute or relative error of at most 10910^{-9}.

4
0 0 10 10
0 0 10 10
10 10 -10 -10
10 0 -20 0
22.2222222222222
3
0 -1 0 2
1 1 1 1
-1 1 -1 1
0
3
0 -1 0 -2
1 1 1 1
-1 1 -1 1
4
1
0 0 0 0
0