#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double EPS = 1e-6;
int a[2005];
int f[2005];
int n, k;
bool check(long long mid) {
  int res = 1e9 + 1LL;
  for (int i = 1; i <= n; i++) {
    f[i] = i - 1;
    for (int j = 1; j < i; j++)
      if (abs(a[i] - a[j]) <= mid * (i - j)) {
        f[i] = min(f[i], f[j] + (i - j - 1));
      }
    res = min(res, f[i] + (n - i));
  }
  return res <= k;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  long long left = 0LL, right = 2e9 + 1LL;
  long long ans = 0LL;
  while (left < right) {
    long long mid = (left + right) >> 1;
    if (check(mid))
      ans = right = mid;
    else
      left = mid + 1;
  }
  printf("%I64d\n", ans);
  return 0;
}
