B
B
Blunker2015-04-08 15:54:03
Programming
Blunker, 2015-04-08 15:54:03

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.

There is such a task, in the explanation it is written that you need to use a binary search for the answer. Google returned no results.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question