Title Description
You are given nn points on the straight line — the positions ( xx -coordinates) of the cities and mm points on the same line — the positions ( xx -coordinates) of the cellular towers. All towers work in the same way — they provide cellular network for all cities, which are located at the distance which is no more than rr from this tower.
Your task is to find minimal rr that each city has been provided by cellular network, i.e. for each city there is at least one cellular tower at the distance which is no more than rr .
If r=0r=0 then a tower provides cellular network only for the point where it is located. One tower can provide cellular network for any number of cities, but all these cities must be at the distance which is no more than rr from this tower.
Input Format
The first line contains two positive integers nn and mm ( 1<=n,m<=10^{5}1<=n,m<=105 ) — the number of cities and the number of cellular towers.
The second line contains a sequence of nn integers a_{1},a_{2},...,a_{n}a1,a2,...,an ( -10^{9}<=a_{i}<=10^{9}−109<=ai<=109 ) — the coordinates of cities. It is allowed that there are any number of cities in the same point. All coordinates a_{i}ai are given in non-decreasing order.
The third line contains a sequence of mm integers b_{1},b_{2},...,b_{m}b1,b2,...,bm ( -10^{9}<=b_{j}<=10^{9}−109<=bj<=109 ) — the coordinates of cellular towers. It is allowed that there are any number of towers in the same point. All coordinates b_{j}bj are given in non-decreasing order.
Output Format
Print minimal rr so that each city will be covered by cellular network.
Translation of the meaning of problems
Gives the n cities on the straight line position (x-coordinate) and the position (x-coordinate) on the same straight line of m cell tower. All the tower works the same way - they provide the cellular network to all cities, these cities are located in order to cover the distance from the cellular network tower does not exceed r's.
Your task is to find that each city can be minimized r value of cellular network coverage that each city is in the range of distances r there is at least one cellular tower.
If r = 0, it provides the only tower in the position of the cellular network. A cellular network tower can provide any number of cities, but all these cities must not exceed the distance r of the distance tower.
Input Format
The first line contains two positive integers n and m, n represent cities and m have cellular towers.
The second line contains n integers A [. 1], A [2] ... A n , denotes the location of each city (x-coordinate)
The third line contains integers m B [. 1], B [2] ... B m , indicates the position of each cell tower (x-coordinate)
Note that allowing a plurality of the same city, or cellular tower location.
Output Format
The minimum output r, such that each city is covered by a cellular network.
data range
1<=n,m<=10^5
-10^9<=a[i]<=10^9
-10^9<=b[j]<=10^9
Sample input and output
3 2 -2 2 4 -3 0
4
5 3 1 5 10 14 17 4 11 15
3
ideas
note the minimum r is 0, and then two.
CODE