#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1000 + 5;
const long long INF = 1000ll * 1000 * 1000 * 1000 * 1000 * 1000;
int n, k, dp[maxn], a[maxn];
bool check(long long x) {
  for (int i = 1; i <= n; i++) {
    dp[i] = i - 1;
    for (int j = 1; j < i; j++) {
      if (abs(a[i] - a[j]) <= (i - j) * x)
        dp[i] = min(dp[i], dp[j] + i - j - 1);
      if (dp[i] + n - i <= k) return true;
    }
  }
  return false;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  long long l = -1, r = INF + 1, mid;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  cout << r << endl;
  return 0;
}
