#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long l, r, mmax = 0;
long long a[2000 + 5], dp[2000 + 5];
bool judge(long long x) {
  for (int i = 1; i <= n; i++) {
    dp[i] = i - 1;
    for (int j = i - 1; j >= 1; j--) {
      if (abs(a[i] - a[j]) <= (i - j) * x)
        dp[i] = min(dp[i], dp[j] + i - j - 1);
    }
    if (dp[i] + n - i <= k) return true;
  }
  return false;
}
int main() {
  scanf("%lld%lld", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 2; i <= n; i++) mmax = max(mmax, abs(a[i] - a[i - 1]));
  l = 0;
  r = mmax;
  while (l < r) {
    long long mid = (l + r) >> 1;
    if (judge(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%lld\n", l);
  return 0;
}
