Two suppliers publish price catalogs, each already sorted in non-decreasing order. You want to find the closest match: choose one price from catalog A and one from catalog B so that the absolute difference between them is as small as possible, and report that smallest difference.
Input format
Line 1: two integers n and m, the sizes of catalog A and catalog B.
Line 2: n non-decreasing integers, catalog A.
Line 3: m non-decreasing integers, catalog B.
Output format
A single integer: the minimum possible value of |A[i] - B[j]|.
Constraints
- 1 ≤ n, m ≤ 100000
- -1000000000 ≤ each price ≤ 1000000000
- Both catalogs are given in non-decreasing order.