#include <bits/stdc++.h>
using namespace std;
const int maxn = 2001;
const int inf = 1000000000;
int d[maxn], a[maxn], n, k;
bool check(int x) {
  int ans = inf;
  for (int i = 1; i <= n; i++) {
    d[i] = i - 1;
    for (int j = 1; j < i; j++)
      if (abs(a[i] - a[j]) <= (i - j) * 1ll * x)
        d[i] = min(d[i], d[j] + i - j - 1);
    ans = min(ans, d[i] + n - i);
  }
  if (ans <= k) return true;
  return false;
}
int main() {
  cin >> n >> k;
  int l = -1, r = 0, mid;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    r = max(r, (i == 1 ? r : abs(a[i] - a[i - 1])));
  }
  while (r - l > 1) {
    mid = (l + 0ll + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  cout << r;
  return 0;
}
