#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e3 + 5;
long long dp[MAXN];
int N, K, A[MAXN];
bool valid(long long x) {
  for (int i = 0; i < N; ++i) dp[i] = i;
  for (int i = 0; i < N; ++i)
    for (int j = i + 1; j < N; ++j)
      if (abs(A[i] - A[j]) <= (j - i) * x)
        dp[j] = min(dp[j], dp[i] + (j - i - 1));
  for (int i = 0; i < N; ++i)
    if (dp[i] + N - i - 1 <= K) return true;
  return false;
}
int main() {
  scanf("%d %d", &N, &K);
  for (int i = 0; i < N; ++i) scanf("%d", &A[i]);
  long long lo = 0, hi = 2e9, mid, res;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    if (valid(mid))
      hi = mid - 1, res = mid;
    else
      lo = mid + 1;
  }
  printf("%lld\n", res);
  return 0;
}
