Cars & garages algorithm

Hello! I don`t to know how to solve this problem: We have X garages and Y cars (we write them the first row in input), the second row we write X numbers which are the coordinates of the garages (they are in line). The question is to find maximum distance between the nearest two cars.
Restrictions: 1 <= X <= 100000, 2 <= Y <= X.

For example:
INPUT
5 2
5 8 12 32 1

OUTPUT
31

INPUT
7 3
1 15 35 10 69 60 28

OUTPUT
34

Thank you! :)
The question is to find maximum distance between the nearest two cars.
¿Can you explain the output? ¿which cars are the nearest in each case?
Topic archived. No new replies allowed.