#include <bits/stdc++.h>
using namespace std;
const int Sn = 2020;
int n, K;
int a[Sn];
int f[Sn];
long long Lim;
bool check(int _Lim) {
  int cur = 0;
  Lim = _Lim;
  for (int i = 1; i <= n; i++) {
    f[i] = 0;
    for (int j = 1; j < i; j++) {
      long long dE = abs(a[i] - a[j]);
      if (dE <= Lim * (i - j)) f[i] = max(f[i], f[j]);
    }
    if (f[i]++, f[i] > cur) cur = f[i];
  }
  return (n - cur <= K);
}
int main() {
  cin >> n >> K;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int L, R, M;
  for (L = 0, R = 2 * (int)1e9; M = ((long long)L + R) / 2, L < R;)
    if (check(M))
      R = M;
    else
      L = M + 1;
  cout << L << endl;
}
