QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 128 MB 總分: 100

#16140. Covering Problem

统计

A person has planted $N$ small saplings on a mountain. Winter has arrived, and the temperature has dropped rapidly. The saplings are too fragile to withstand the cold, so the owner wants to cover them with plastic sheets. After much thought, he decides to use $3$ square plastic sheets of size $L \times L$ to cover all the saplings. We can represent the mountain using a Cartesian coordinate system, where the coordinates of the $i$-th sapling are $(X_i, Y_i)$. The sides of the $3$ squares must be parallel to the coordinate axes. A point is considered covered if it lies on the boundary of a square. Naturally, we want the area of the plastic sheets to be as small as possible, which means we need to find the minimum value of $L$.

Input

The first line contains a positive integer $N$, representing the number of trees.

The next $N$ lines each contain two integers $X_i, Y_i$, representing the coordinates of the $i$-th tree. It is guaranteed that no two trees have the same coordinates.

Output

Output a single line containing the minimum value of $L$.

Constraints

  • $100\%$ of the data: $-1,000,000,000 \le X_i, Y_i \le 1,000,000,000$
  • $30\%$ of the data: $N \le 100$
  • $50\%$ of the data: $N \le 2000$
  • $100\%$ of the data: $N \le 20000$

Examples

Input 1

4
0 1
0 -1
1 0
-1 0

Output 1

1

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.