CF702C.Cellular Network

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

输入格式

The first line contains two positive integers nn and mm ( 1<=n,m<=1051<=n,m<=10^{5} ) — the number of cities and the number of cellular towers.

The second line contains a sequence of nn integers a1,a2,...,ana_{1},a_{2},...,a_{n} ( 109<=ai<=109-10^{9}<=a_{i}<=10^{9} ) — the coordinates of cities. It is allowed that there are any number of cities in the same point. All coordinates aia_{i} are given in non-decreasing order.

The third line contains a sequence of mm integers b1,b2,...,bmb_{1},b_{2},...,b_{m} ( 109<=bj<=109-10^{9}<=b_{j}<=10^{9} ) — the coordinates of cellular towers. It is allowed that there are any number of towers in the same point. All coordinates bjb_{j} are given in non-decreasing order.

输出格式

Print minimal rr so that each city will be covered by cellular network.

输入输出样例

  • 输入#1

    3 2
    -2 2 4
    -3 0
    

    输出#1

    4
    
  • 输入#2

    5 3
    1 5 10 14 17
    4 11 15
    

    输出#2

    3
    
首页