Convicts in jail

There are nn jails beside a straight road. You know the position (in km) of each jail. Please choose the jails where to confine mm dangerous convicts in order to maximize the minimum distance between two convicts.

For instance, consider five jails at positions 1, 10, 23, 42 and 50, and three convicts. Here, the optimum solution is to use the first, third and fifth jail, with a minimum distance of 22.

Input

Input consists of several cases, each with mm and nn, followed by the positions of the nn jails. Assume 2mn1042 \le m \le n \le 10^4, and that the nn positions are different and between 0 and 10910^9.

Output

For every case, print the largest possible distance between the two nearest convicts.

Problem information

Author: Javier Nistal

Generation: 2026-01-25T11:56:09.163Z

© Jutge.org, 2006–2026.
https://jutge.org