시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
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:

  • reads from the standard input a description of positions of apple trees and apples,
  • computes the smallest distance between an apple and its apple tree,
  • writes the result to the standard output.

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.

예제 입력 1

3 5
10 1 4
2 2 5 7 8

예제 출력 1

1