P1378 Oil Droplet Expansion
Description
Inside a rectangular frame, there are at most $N$ distinct points. If you place a tiny oil droplet at any one of these points, the droplet will keep expanding until it touches another droplet or the boundary of the frame. You must wait for one droplet to finish expanding before placing the next droplet. In what order should you place droplets at these $N$ points so that the total area occupied by all droplets after placement is maximized? (Different droplets do not merge.)
Note: The area of a circle is $S = \pi r^2$, where $r$ is the radius.
Input Format
The first line contains an integer $N$.
The second line contains four integers $x, y, x', y'$, which represent the coordinates of one vertex of the rectangle and its diagonally opposite vertex.
The next $N$ lines each contain two integers $x_i, y_i$, representing the coordinates of the $i$-th point inside the rectangle.
Output Format
One line with a single integer: the minimum remaining area of the rectangle (rounded to the nearest integer).
Explanation/Hint
For $100\%$ of the testdata, $1 \le N \le 6$, and coordinate values are within $[-1000, 1000]$.
Translated by ChatGPT 5