Mice and holes
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
There are mice and holes on a straight line. Each hole can only accommodate mouse. A mouse can stay in its place, move one step to the right from to , or move one step to the left from to . Any of these moves takes minute. Assign mice to holes so that the time when the last mouse hides in a hole is minimized.
Input
The first line contains the number . The second line contains the positions of mice. The third line contains the positions of holes. The positions of mice and holes are integers from to .
Output
Print the minimum time it takes for the last mouse to hide in a hole.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 50%