|Author:||A. Klenin||Time limit:||3 sec|
|Input file:||input.txt||Memory limit:||256 Mb|
The main hall of the Nearsea Institute of Unspecified Underwater Studies has a shape of a long corridor. Along the corridor, there are N aquariums exhibiting various sea creatures. Aquariums are located at distances x1, …, xN from the hall entrance (xi < xi + 1).
The institute has recently got a new director, who decided that the aquarium maintenance is too costly, and issued an order to remove M (0 ≤ M ≤ N − 2) aquariums.
To minimize the disruption to the looks of the hall, it was decided that:
Your program must select aquariums for removal in such a way that the above conditions are satisfied.
Input file contains integers N M followed by N integers xi.
Output file should contain a single integer — the smallest possible maximum distance.
|No.||Input file (
||Output file (|