MLE '19 Contest 4 P5 - Geo

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 128M

Author:
Problem type

Given a set of N points, find the smallest Manhattan distance between any two unique points.

Manhattan distance between two points is defined as the total distance traveled parallel along the x-axis or y-axis.

Input Specification

The first line will contain the integer N (2 \le N \le 1000).

The next N lines will each contain two integers x and y (|x|,|y| \le 10^{18}), representing a point.

Output Specification

A single integer, the smallest Manhattan distance betweeen any two unique points.

Sample Input

3
0 0
10 5
-6 -7

Sample Output

13

Comments

There are no comments at the moment.