#include <bits/stdc++.h>
using namespace std;
long long arr[2003], pd[2003];
int n;
long long solve(long long k) {
  pd[0] = 0;
  for (int i = 1; i < n; i++) {
    pd[i] = i;
    for (int j = i - 1; j >= 0; j--) {
      if (abs(arr[i] - arr[j]) <= k * (i - j)) {
        pd[i] = min(pd[i], pd[j] + (i - j - 1));
      }
    }
  }
  long long res = pd[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    res = min(res, pd[i] + n - i - 1);
  }
  return res;
}
int main() {
  int k;
  cin >> n >> k;
  long long m = -1000000001, M = 1000000001;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] < m) m = arr[i];
    if (arr[i] > M) M = arr[i];
  }
  long long a = 0;
  long long b = M - m;
  while (a < b) {
    long long m = a + (b - a) / 2;
    if (solve(m) <= k) {
      b = m;
    } else {
      a = m + 1;
    }
  }
  cout << a << endl;
  return 0;
}
