#abc212c. [abc212_c]Min Difference
[abc212_c]Min Difference
Problem Statement
You are given two sequences: consisting of positive integers, and consisting of positive integers.
Find the minimum difference of an element of and an element of , that is, $\\displaystyle \\min_{ 1\\leq i\\leq N}\\displaystyle\\min_{1\\leq j\\leq M} \\lvert A_i-B_j\\rvert$.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 2
1 6
4 9
Sample Output 1
2
Here is the difference for each of the four pair of an element of and an element of : , , , and . We should print the minimum of these values, or .
Sample Input 2
1 1
10
10
Sample Output 2
0
Sample Input 3
6 8
82 76 82 82 71 70
17 39 67 2 45 35 22 24
Sample Output 3
3