#P1378. 油滴扩展

    ID: 373 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>搜索福建省历届夏令营枚举,暴力深度优先搜索,DFS

油滴扩展

Description

Inside a rectangular frame, there are at most NN 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 NN 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=πr2S = \pi r^2, where rr is the radius.

Input Format

The first line contains an integer NN.

The second line contains four integers x,y,x,yx, y, x', y', which represent the coordinates of one vertex of the rectangle and its diagonally opposite vertex.

The next NN lines each contain two integers xi,yix_i, y_i, representing the coordinates of the ii-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).

2
20 0 10 10
13 3
17 7

50

Hint

For 100%100\% of the testdata, 1N61 \le N \le 6, and coordinate values are within [1000,1000][-1000, 1000].

Translated by ChatGPT 5