#include <bits/stdc++.h>
using namespace std;
long long n, k, a[2005], dp[2005];
bool ju(long long x) {
  for (long long i = 1; i <= n; i++) {
    dp[i] = i - 1;
    for (long long j = 1; j < i; j++) {
      if (abs(a[j] - a[i]) <= (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);
  long long mx = 0;
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    if (i > 1) mx = max(mx, abs(a[i] - a[i - 1]));
  }
  long long l = 0, r = mx;
  while (l < r) {
    long long mid = (l + r) / 2;
    if (ju(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%lld\n", l);
  return 0;
}
