#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 7;
const int maxn = 2e3 + 7;
int n, k, a[maxn], f[maxn];
long long l, r;
inline void read(int &x);
void nhap() {
  read(n);
  read(k);
  for (int i = (1), _b = (n); i <= _b; ++i) {
    read(a[i]);
  }
}
bool check(long long x) {
  int res = n;
  for (int i = (1), _b = (n); i <= _b; ++i) {
    f[i] = i - 1;
    for (int j = (1), _b = (i - 1); j <= _b; ++j)
      if (abs(a[i] - a[j]) <= (i - j) * x) f[i] = min(f[i], f[j] + i - j - 1);
    if (f[i] + n - i <= k) return true;
  }
  return false;
}
void solve() {
  l = 0;
  r = 1LL * 2e9 + 1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
}
void print() { printf("%I64d", l); }
int main() {
  nhap();
  solve();
  print();
}
void read(int &x) {
  x = 0;
  register char ch;
  bool neg = false;
  ch = getchar();
  for (;;) {
    if (ch == '-') break;
    if (ch >= '0' && ch <= '9') break;
    ch = getchar();
  }
  if (ch == '-')
    neg = true;
  else
    x = ch - '0';
  for (;;) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    x = (x << 3) + (x << 1) + ch - '0';
  }
  if (neg) x = -x;
}
