#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void chkmin(int &a, int b) {
  a = min(a, b);
  return;
}
long long n, k;
vector<long long> a;
int dp[2005];
long long check(long long mid) {
  int i, j;
  for (i = 0; i < n; i++) {
    dp[i] = i;
    for (j = 0; j < i; j++) {
      if (abs(a[i] - a[j]) <= (i - j) * mid) chkmin(dp[i], dp[j] + i - j - 1);
    }
    if (dp[i] + n - 1 - i <= k) return 1;
  }
  return 0;
}
void solve() {
  cin >> n >> k;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  long long l, r;
  l = 0;
  r = *max_element(a.begin(), a.end()) - *min_element(a.begin(), a.end());
  while (r - l > 0) {
    long long mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << r << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
