#include <bits/stdc++.h>
using namespace std;
int a[2010], best[2010], val[2010];
int _abs(int t) {
  if (t < 0) return -t;
  return t;
}
int main() {
  int N, K, t;
  long long fir, se, mid;
  scanf("%d%d", &N, &K);
  for (int i = 0; i < N; i++) scanf("%d", a + i);
  fir = -1;
  se = 2 * 1000000000;
  while (se - fir > 1) {
    mid = (se + fir) / 2;
    memset(best, 0x3f3f3f3f, sizeof(best));
    memset(val, 0x3f3f3f3f, sizeof(val));
    best[0] = 0;
    val[0] = 0;
    for (int i = 1; i < N; i++) {
      best[i] = best[i - 1] + 1;
      val[i] = i;
      for (int j = i - 1; j >= 0; j--) {
        t = _abs(a[i] - a[j]);
        if (t <= mid * (i - j)) val[i] = min(val[i], val[j] + (i - j - 1));
      }
      best[i] = min(best[i], val[i]);
    }
    if (best[N - 1] > K)
      fir = mid;
    else
      se = mid;
  }
  printf("%I64d\n", se);
  return 0;
}
