#P2218. [HAOI2007] 覆盖问题

    ID: 1192 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>贪心2007河南二分各省省选深度优先搜索,DFS

[HAOI2007] 覆盖问题

Description

Someone planted NN saplings on a mountain. Winter has come, the temperature dropped sharply, and the saplings are too fragile. The owner wants to cover them with some plastic sheets. After careful consideration, he decides to use 33 square plastic sheets of size L×LL \times L to cover the saplings. We set up a 2D Cartesian coordinate system on the mountain; the coordinates of the ii-th sapling are (Xi,Yi)(X_i, Y_i). The 33 squares of size L×LL \times L must be axis-aligned. A point lying on the boundary of a square is also considered covered. Of course, we want the plastic area to be as small as possible; that is, find the minimal LL.

Input Format

The first line contains an integer NN.
The next NN lines each contain two integers Xi,YiX_i, Y_i, giving the coordinates of the ii-th tree. It is guaranteed that no two trees share the same coordinates.

Output Format

Output one line: the minimal value of LL.

4
0 1
0 -1
1 0
-1 0

1

Hint

For 100%100\% of the testdata, 1,000,000,000Xi,Yi1,000,000,000-1,000,000,000 \le X_i, Y_i \le 1,000,000,000.

For 30%30\% of the testdata, N100N \le 100.

For 50%50\% of the testdata, N2000N \le 2000.

For 100%100\% of the testdata, N20000N \le 20000.

Translated by ChatGPT 5