#P2479. [SDOI2010] 捉迷藏

    ID: 1491 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>搜索2010各省省选递归山东枚举,暴力

[SDOI2010] 捉迷藏

Description

Crab-style hide-and-seek, as the name suggests, means they can only move horizontally or vertically while playing.

After a lonely round of rock-paper-scissors, they decided that iPig would seek giPi. Since they both know the layout of the Big Fat Pig School very well, giPi will only hide at one of NN hidden locations, and iPig will only search among those same NN locations.

At the start of the game, they choose one location from these NN hidden locations. iPig stays put, and giPi uses 3030 seconds to run away (clearly, giPi will not stay at the starting location). Then iPig will randomly search for giPi until he finds him.

Because iPig is lazy, he always walks along the shortest path. Moreover, he does not choose the starting location arbitrarily—he wants to find a location such that the difference between the distance to the farthest other location and the distance to the nearest other location (excluding the starting location itself) is minimized. iPig now wants to know what this minimum difference is.

Since iPig does not have a computer at hand, he cannot program to solve such a simple problem. He immediately calls you and asks for help. iPig gives you the coordinates of the NN hidden locations in the Big Fat Pig School. Please write a program to answer iPig’s question.

Input Format

Line 11: An integer NN.

The next NN lines: Each line contains two integers Xi,YiX_i, Y_i, representing the coordinates of the ii-th location.

Output Format

One integer, the minimum possible value of the distance difference.

4
0 0
1 0
0 1
1 1

1

Hint

Constraints:

  • In 30%30\% of the testdata, 2N1032 \le N \le 10^3.
  • In 100%100\% of the testdata, 2N1052 \le N \le 10^5, 0Xi,Yi1090 \le X_i, Y_i \le 10^9.

It is guaranteed that all points are distinct.

Translated by ChatGPT 5