#include <bits/stdc++.h>
using namespace std;
int N, K, a[2005], f[2005];
bool ok(long long x) {
  for (int i = 1; i <= N; i++) {
    f[i] = i - 1;
    for (int j = 1; j < i; j++)
      if (abs(a[i] - a[j]) <= x * (i - j))
        f[i] = std::min(f[i], f[j] + i - j - 1);
    if (f[i] + N - i <= K) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 1; i <= N; i++) scanf("%d", &a[i]);
  long long l = 0, r = 2e9, ans = 0;
  for (; l <= r;) {
    long long m = (l + r) >> 1;
    if (ok(m))
      r = m - 1, ans = m;
    else
      l = m + 1;
  }
  printf("%I64d\n", ans);
}
