#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[3000];
int dp[3000];
int f(int d) {
  dp[1] = 0;
  for (int i = 2; i <= n; i++) {
    dp[i] = i - 1;
    for (int j = 1; j < i; j++) {
      int e = a[i] - a[j];
      if (e < 0) e = -e;
      if ((e + i - j - 1) / (i - j) <= d) {
        dp[i] = min(dp[i], dp[j] + (i - j - 1));
      }
    }
    if (n - i + dp[i] <= k) return 1;
  }
  return 0;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  int l = -1;
  int r = 2000000001;
  while (l + 1 < r) {
    int c = l + (r - l) / 2;
    if (f(c))
      r = c;
    else
      l = c;
  }
  cout << r << endl;
  return 0;
}
