#include #include #include using namespace std; int max_dist(vector &a, const int N) { const int L = a.size(); sort(a.begin(), a.end()); int min_d = 1; int max_d = (a[L - 1] - a[0]) / (N - 1); while (min_d <= max_d) { int d = min_d + (max_d - min_d) / 2; int count = 1; int last = 0; for (int i = 1; i < L; i++) { if (a[i] - a[last] >= d) { count++; last = i; } } if (count >= N) { min_d = d + 1; } else { max_d = d - 1; } } return max_d; } int main(void) { int N, L; cin >> N >> L; vector a(L); for (int i = 0; i < L; i++) { cin >> a[i]; } cout << max_dist(a, N) << endl; return 0; }