#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e3 + 5;
int n, k;
int a[MAX];
int best[MAX];
bool ok(long long limit) {
  for (int i = int(1); i < int(n + 1); i++) {
    best[i] = i - 1;
    for (int j = int(1); j < int(i); j++) {
      long long distance = abs(a[i] - a[j]);
      if (distance <= (i - j) * limit) {
        best[i] = min(best[i], best[j] + i - j - 1);
      }
    }
    if (best[i] + n - i <= k) {
      return true;
    }
  }
  return false;
}
int main() {
  scanf("%d %d", &n, &k);
  if (n == 1) {
    puts("0");
    return 0;
  }
  for (int i = int(1); i < int(n + 1); i++) {
    scanf("%d", a + i);
  }
  long long left = 0, right = (long long)1e10;
  long long ans = -1;
  while (left <= right) {
    long long mid = (left + right) / 2;
    if (ok(mid)) {
      ans = mid;
      right = mid - 1;
    } else {
      left = mid + 1;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
