#include <bits/stdc++.h>
using namespace std;
int n, k;
long long a[2005];
long long l, r;
bool ch(long long x) {
  long long dp[2005];
  for (int i = 0; i < n; ++i) dp[i] = i;
  int cur = n - 1;
  for (int i = 1; i < n; ++i) {
    for (int j = i - 1; j >= 0; --j)
      if (abs(a[i] - a[j]) <= (i - j) * x)
        dp[i] = min(dp[i], 1LL * dp[j] + i - j - 1);
    cur = min(1LL * cur, 1LL * dp[i] + n - i - 1);
  }
  return (cur <= k);
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; ++i)
    scanf("%lld", &a[i]), r = max(r, (long long)a[i] - (i ? a[i - 1] : a[i]));
  while (r - l > 1) {
    long long mid = (r + l) / 2;
    if (ch(mid))
      r = mid;
    else
      l = mid;
  }
  if (ch(l))
    printf("%lld", l);
  else
    printf("%lld", r);
  return 0;
}
