#include <bits/stdc++.h>
using namespace std;
const int MAX_BUF_SIZE = 16384;
char BUFOR[MAX_BUF_SIZE];
int BUF_SIZE, BUF_POS;
char ZZZ;
int _MINUS;
const int MXN = 2010;
const int C = 262144;
const int INF = 2 * 1000000001;
const int MAX_VAL = 1000000000;
int n, k;
int D[MXN];
int a[MXN];
bool check(int C) {
  for (int i = (0); i <= (n); i++) D[i] = INF;
  D[1] = 0;
  D[0] = 0;
  for (int i = (2); i <= (n); i++) {
    D[i] = i - 1;
    for (int j = (i - 1); j >= (1); j--) {
      if ((long long int)(i - j) * C >= abs(a[j] - a[i]) && D[j] != INF)
        D[i] = min(D[i], (i - j - 1) + D[j]);
    }
  }
  int res = D[n];
  for (int i = (0); i <= (n - 1); i++) res = min(res, n - i + D[i]);
  return res <= k;
}
void test() {
  scanf("%d %d", &n, &k);
  int maks = -INF, mini = INF;
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &a[i]);
    maks = max(a[i], maks);
    mini = min(a[i], mini);
  }
  int L = 0, R = abs(maks - mini);
  int wyn = abs(maks - mini);
  while (L <= R) {
    int second = ((long long int)R + L) / 2;
    if (check(second)) {
      wyn = min(wyn, second);
      R = second - 1;
    } else
      L = second + 1;
  }
  printf("%d\n", wyn);
}
int main() {
  int te = 1;
  while (te--) test();
  return 0;
}
