#include <bits/stdc++.h>
using namespace std;
long long f[2001];
long long i, j, k, p, n;
long long l, r;
int a[2001];
bool check(int x) {
  for (i = 1; i <= n; ++i) {
    f[i] = i - 1;
    for (j = 1; j < i; ++j)
      if (abs(a[j] - a[i]) <= x * (i - j)) {
        f[i] = min(f[i], f[j] + i - j - 1);
      }
    if (f[i] + n - i <= k) return true;
  }
  return false;
}
int main() {
  scanf("%I64d%I64d\n", &n, &k);
  for (i = 1; i <= n; ++i) scanf("%d", a + i);
  l = 0;
  r = (int)2e9;
  while (l <= r) {
    if (check((l + r) >> 1))
      r = ((l + r) >> 1) - 1;
    else
      l = ((l + r) >> 1) + 1;
  }
  printf("%I64d\n", l);
  return 0;
}
