eolymp
bolt
Try our new interface for solving problems
Problems

Ice-Cream

Ice-Cream

The beach stretches along the seacoast like a narrow strip. At some points of the beach the ice cream stalls are located. One day not all the ice cream sellers come to work. Distribute the sellers among the ice-cream stalls so that the minimum distance between them is as much as possible. So they will interfere less with each other. \InputFile The first line contains the number of stalls \textbf{n} (\textbf{2} < \textbf{n} < \textbf{10001}) and the number of ice cream sellers k (\textbf{1} < \textbf{k} < \textbf{n}) at work. The second line contains \textbf{n} positive integers in increasing order - the coordinates of the stalls (the coordinates are not greater than \textbf{10^9}). \OutputFile Print one number - the minimum distance between the adjacent stalls in the optimal arrangement.
Time limit 1 second
Memory limit 128 MiB
Input example #1
5 3
1 2 3 100 1000
Output example #1
99
Input example #2
8 4
2 7 10 15 18 22 25 27
Output example #2
8