#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
vector<long long> dp;
bool solve(long long x, long long k) {
  int n = a.size();
  dp.assign(n + 1, 1000000000);
  for (int i = 0; i < n + 1; ++i) dp[i] = i;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      if (llabs(a[i] - a[j]) <= (i - j) * 1ll * x) {
        dp[i] = min(dp[i], dp[j] + i - j - 1);
      }
    }
  }
  for (int i = 0; i < n; ++i) dp[n] = min(dp[n], dp[i] + n - i - 1);
  return dp[n] <= k;
}
int main() {
  int n, k;
  cin >> n >> k;
  a.assign(n, 0);
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long l = 0, r = 2000000000;
  while (l < r) {
    long long m = (l + r) / 2;
    if (solve(m, k))
      r = m;
    else
      l = m + 1;
  }
  cout << r << endl;
  return 0;
}
