#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long a[3000];
long long f[3000];
int check(long long x) {
  for (int i = 1; i <= n; i++) {
    f[i] = i - 1;
    for (int j = 1; j < i; j++)
      if (abs(a[i] - a[j]) <= x * (i - j)) f[i] = min(f[i], f[j] + i - j - 1);
    if (f[i] + n - i <= k) return 1;
  }
  return 0;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long l = 0, r = 2e9;
  long long ans;
  while (l <= r) {
    int mid = l + r >> 1;
    if (check(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  cout << ans << endl;
  return 0;
}
