AtCoder Regular Contest 069
F
Flags
AtCoder
⌀ 3200
原题
← E→
翻译中…

Problem Statement

翻译中…

Snuke loves flags.

翻译中…

Snuke is placing $N$ flags on a line.

翻译中…

The $i$-th flag can be placed at either coordinate $x_i$ or coordinate $y_i$.

翻译中…

Snuke thinks that the flags look nicer when the smallest distance between two of them, $d$, is larger. Find the maximum possible value of $d$.

翻译中…

Constraints

翻译中…
  • $2 ≤ N ≤ 10^{4}$
  • $1 ≤ x_i, y_i ≤ 10^{9}$
  • $x_i$ and $y_i$ are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N
x_1 y_1
:
x_N y_N

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
3
1 3
2 5
1 9
Output #1
4
The optimal solution is to place the first flag at coordinate $1$, the second flag at coordinate $5$ and the third flag at coordinate $9$. The smallest distance between two of the flags is $4$ in this case.
Input #2
5
2 2
2 2
2 2
2 2
2 2
Output #2
0
There can be more than one flag at the same position.
Input #3
22
93 6440
78 6647
862 11
8306 9689
798 99
801 521
188 206
6079 971
4559 209
50 94
92 6270
5403 560
803 83
1855 99
42 504
75 484
629 11
92 122
3359 37
28 16
648 14
11 269
Output #3
17
题目信息
题号
arc069_d
时间限制
5 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。