#include <bits/stdc++.h>
using namespace std;
long long N, K;
long long num[3000];
long long OAO[3000];
bool test(long long c) {
  for (long long Ni = 0; Ni <= N; Ni++) {
    OAO[Ni] = Ni;
    for (long long Nj = 0; Nj < Ni; Nj++) {
      if (Ni != N && abs(num[Ni] - num[Nj]) > (long long)(c) * (Ni - Nj))
        continue;
      OAO[Ni] = min(OAO[Ni], OAO[Nj] + Ni - Nj - 1);
    }
  }
  if (OAO[N] > K)
    return false;
  else
    return true;
}
int main() {
  scanf("%I64d %I64d", &N, &K);
  long long p = 0;
  for (long long Ni = 0; Ni < N; Ni++) {
    scanf("%I64d", &num[Ni]);
    if (Ni) p = max(p, (long long)abs(num[Ni] - num[Ni - 1]));
  }
  long long l = -1, r = p, mid;
  while (l + 1 != r) {
    mid = (l + r) / 2;
    if (test(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%I64d\n", r);
}
