Problem1190--【数组的距离】

1190: 【数组的距离】

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

已知元素从小到大排列的两个数组x[]和y[],请写出一个程序算出两个数组彼此之间差的绝对值中最小的一个,这叫做数组的距离

Input

第一行为两个整数m, n(1≤m, n≤1000),分别代表数组f[], g[]的长度。
第二行有m个元素,为数组f[]。
第三行有n个元素,为数组g[]。

Output

数组的最短距离

Sample Input Copy

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

Sample Output Copy

1

Source/Category