#P425. 【例73.2】 数组的距离

【例73.2】 数组的距离

Description

Given two arrays x[]x[] and y[]y[] of lengths nn and mm respectively. Take any element x[i]x[i] from xx and any element y[j]y[j] from yy, their absolute difference is x[i]y[j]|x[i] - y[j]|. There are n×mn × m such differences, and the minimum value among them is called the distance between the arrays.
Please write a program to find the distance between the arrays.

Input Format

The first line contains two integers nn and mm (1n,m1061≤n,m≤10^6).
The next line contains nn integers representing array xx.
The next line contains mm integers representing array yy.
The absolute values of the array elements are less than or equal to 10810^8.

Output Format

Output a single integer representing the distance between the two arrays.

Sample

5 5
1 2 3 4 5
6 7 8 9 10
1