#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
const int inf = -1u / 2;
int a[maxn], d[maxn][2];
int n, k;
int abs(int x) {
  if (x < 0) return -x;
  return x;
}
bool f(int mid) {
  int i, j;
  for (i = 1; i <= n; i++) d[i][0] = d[i][1] = inf;
  d[1][0] = 0;
  d[1][1] = 1;
  for (i = 2; i <= n; i++) {
    d[i][1] = min(d[i - 1][0], d[i - 1][1]) + 1;
    for (j = 1; j < i; j++) {
      long long x = i;
      x -= j;
      x *= mid;
      long long y = (long long)abs(a[i] - a[j]);
      if (x >= y) {
        d[i][0] = min(d[i][0], d[j][0] + i - j - 1);
      }
    }
    d[i][0] = min(d[i][0], i - 1);
  }
  if (min(d[n][0], d[n][1]) > k) return false;
  return true;
}
int main() {
  int i, j;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    int sum = 0;
    for (i = 1; i < n; i++) sum = max(sum, abs(a[i] - a[i + 1]));
    int L = 0, R = sum;
    while (L < R) {
      long long s = (long long)L + (long long)R;
      s /= 2;
      int mid = s;
      if (f(mid))
        R = mid;
      else
        L = mid + 1;
    }
    printf("%d\n", L);
  }
}
