A well-known Polish proverb says: "The apple always falls near the apple tree." Your task is to test this proverb experimentally.
The positions of the apple trees and the apples are points on a plane. The distance between two points is measured with the Manhattan metric:
d((x1,y1),(x2,y2))=∣x1−x2∣+∣y1−y2∣
Assume that every apple has fallen from the apple tree that is closest to it.
Write a program that:
(In English, an equivalent proverb is "Like father, like son" or "Like mother, like daughter.")
The first line contains two integers n and m (1≤n,m≤100000), separated by a single space: the number of apple trees and the number of apples.
The second line contains 2n integers in the range [0,108], separated by single spaces, giving the coordinates of the apple trees: x1 y1 x2 y2 … xn yn.
The third line contains 2m integers in the range [0,108], separated by single spaces, giving the coordinates of the apples: x1′ y1′ x2′ y2′ … xm′ ym′.
Both apple trees and apples are treated as points on the plane, and several apple trees or several apples may lie on the same point.
Print a single integer: the smallest distance between an apple and the apple tree it fell from.