toI(s=readline()) = parse(Int,s) toVI(s=readline()) = map(toI,eachsplit(s)) rep(f,n) = [f() for _ in 1:n] @enum YN Yes=1 No=0 function (@main)(ARGS) n,m = toVI() s = toVI() t = toVI() solve(n,m,s,t) |> println end function solve(n,m,s,t) sort!(s) ok = 0; ng = m+1 mx = 0 while ng-ok > 1 x = (ok+ng)÷2 u = t[1:x] |> sort! mx = 0 for si in s if si ≥ get(u,1,1<<30) mx = max(mx,si-popfirst!(u)) end end if isempty(u) ok = x else ng = x end end return mx end