#include <bits/stdc++.h>
using namespace std;
const long long maxx = 2017, inf = 2e9 + 2;
long long l, r, ans[maxx], n, k, a[maxx];
bool ok(long long x) {
  for (long long i = 0; i < n; i++) {
    ans[i] = 1;
    for (long long j = 0; j < i; j++)
      if (abs(a[i] - a[j]) <= (i - j) * x) ans[i] = max(ans[i], ans[j] + 1);
    if (n - ans[i] <= k) return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  l = -1, r = inf;
  while (l + 1 != r) {
    long long mid = (l + r) / 2;
    if (ok(mid))
      r = mid;
    else
      l = mid;
  }
  cout << r << endl;
  return 0;
}
