|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||1||1||1||100.000%|
A known Polish proverb is: 'The apple always falls near the apple tree'1. Your task is to check this proverb experimentally. For simplicity let us assume that both apple trees and apples stand in one line, so their positions can be described by a single coordinate. Let us also assume that every apple has fallen from the apple tree closest to it.
Write a program that:
1An English equivalent of this proverb is: 'Like father, like son' or 'Like mother, like daughter'.
The first line of input contains two integers n and m (1 ≤ n, m ≤ 100 000), separated with a single space and denoting the number of apple trees and the number of apples. The second line of input contains n integers from the range [0,108], separated with single spaces and denoting the coordinates of apple trees. The third line of input contains m integers from the range [0,108], separated with single spaces and denoting the coordinates of apples. We treat both apple trees and apples as points on a line; there can be multiple apple trees and multiple apples in one point.
The first and only line of output should contain the smallest distance between an apple and its apple tree.
3 5 10 1 4 2 2 5 7 8