#include <bits/stdc++.h>
using namespace std;
long long a[4444];
long long f[4444];
long long n, m;
bool ff(long long value) {
  if (n <= 1) return true;
  for (long long i = 1; i <= n; i++) {
    f[i] = 1;
    for (long long j = 1; j <= i - 1; j++) {
      long long dist = abs(a[i] - a[j]);
      if (dist <= (i - j) * value) f[i] = max(f[i], f[j] + 1);
    }
  }
  long long answer = 0;
  for (int i = 1; i <= n; i++)
    if (f[i] > answer) answer = f[i];
  return (answer + m >= n);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long L = 0;
  long long R = 4000000000;
  while (R - L > 1) {
    long long M = (R + L) / 2;
    if (ff(M))
      R = M;
    else
      L = M;
  }
  if (ff(L))
    cout << L << endl;
  else
    cout << R << endl;
  return 0;
}
