Answer the question
In order to leave comments, you need to log in
What is binary search by answer?
Stalls are located on the straight line, in which it is necessary to place the cows so that the minimum distance between the cows is as large as possible.
Specifications Input
The first line contains the numbers N (2 < N < 10001) - the number of stalls and K (1 < K < N ) - the number of cows. The second line contains N positive integers in ascending order - the coordinates of the stalls (coordinates do not exceed 109)
Output
Print one number - the largest possible distance.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question