#include <bits/stdc++.h>
using namespace std;
long long int n, a[2005], k, num;
long long int re[2005];
long long int sign[2005];
long long int dis[2005][2005];
long long int f(long long int i) {
  long long int t, to, u;
  if (i == n + 1) return 0;
  if (sign[i] == num) return re[i];
  re[i] = 100000000000LL;
  for (u = i + 1; u <= n + 1; u++) {
    re[i] = min(re[i], f(u) + dis[i][u]);
  }
  sign[i] = num;
  return re[i];
}
bool check(long long int m) {
  long long int i, j;
  long long int mm, xx, yy;
  num = m + 1;
  for (i = 1; i <= n; i++) {
    dis[0][i] = i - 1;
    dis[i][n + 1] = n - i;
  }
  dis[0][n + 1] = n;
  for (i = 1; i <= n - 1; i++) {
    for (j = i + 1; j <= n; j++) {
      mm = m;
      xx = (abs(a[j] - a[i]));
      yy = (j - i);
      if (xx <= mm * yy) {
        dis[i][j] = j - i - 1;
      } else
        dis[i][j] = k + 1;
    }
  }
  if (f(0) <= k) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long int i, l = 0, r = 1000000000000LL, mid;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  while (l < r) {
    if (r - l == 1) {
      if (check(l)) break;
      l = r;
      break;
    }
    mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << endl;
  return 0;
}
