#include <bits/stdc++.h>
using namespace std;
void err(istringstream *iss) {}
template <typename T, typename... Args>
void err(istringstream *iss, const T &$val, const Args &...args) {
  string $name;
  *iss >> $name;
  if ($name.back() == ',') $name.pop_back();
  cout << $name << " = " << $val << "; ", err(iss, args...);
}
int n, m, K, T, Q, cn;
int a[2005], memo[2005][2005];
long long mid;
bitset<2005> vstd[2005];
int dp(int at, int lstUnchngd) {
  if (at == n) return 0;
  int &ret = memo[at][lstUnchngd];
  if (vstd[at][lstUnchngd]) return ret;
  vstd[at][lstUnchngd] = 1;
  ret = 1 + dp(at + 1, lstUnchngd);
  long long mxChng = (at - lstUnchngd) * 1ll * mid;
  if (lstUnchngd == 2005 - 1 or
      (a[at] >= a[lstUnchngd] - mxChng and a[at] <= a[lstUnchngd] + mxChng))
    ret = min(ret, dp(at + 1, at));
  return ret;
}
int dp2() {
  for (int i = 0; i < 2005; i++) {
    memo[n][i] = 0;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = i - 1; j >= 0; j--) {
      int &ret = memo[i][j];
      ret = 1 + memo[i + 1][j];
      long long mxChng = (i - j) * mid;
      if (a[i] >= a[j] - mxChng and a[i] <= a[j] + mxChng)
        ret = min(ret, memo[i + 1][i]);
    }
    memo[i][2005 - 1] = min(1 + memo[i + 1][2005 - 1], memo[i + 1][i]);
  }
  return memo[0][2005 - 1];
}
int main() {
  cin.tie(NULL);
  scanf("%d%d", &n, &K);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  long long lo = 0, hi = (1000000007 - 7) << 1, ans = -1;
  while (lo <= hi) {
    mid = (hi + lo) >> 1;
    if (dp2() <= K) {
      hi = mid - 1;
      ans = mid;
    } else
      lo = mid + 1;
  }
  printf("%lld\n", ans);
  return 0;
}
