#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2222;
const int oo = 2123456789;
int n, k, l, r, dp[MAX_N], niz[MAX_N];
int ok(int x) {
  if (n < 2) {
    return true;
  }
  for (int i = 1; i < n; i++) {
    dp[i] = i;
    for (int j = 0; j < i; j++) {
      if (abs(niz[i] - niz[j]) <= (i - j) * x) {
        dp[i] = min(dp[i], dp[j] + i - j - 1);
      }
      if (dp[i] + n - 1 - i <= k) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> niz[i];
  }
  for (l = 0, r = oo; l < r;) {
    int mid = (1LL * l + r) / 2;
    if (ok(mid)) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  cout << l;
}
