#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010;
const int INF = 2000000010;
long long A[MAXN];
long long dp[MAXN];
int main() {
  int N, K;
  cin >> N >> K;
  for (int i = 1; i <= N; i++) cin >> A[i];
  long long lo = 0, hi = INF, res = INF;
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    for (int i = 1; i <= N; i++) dp[i] = 1;
    for (int i = 1; i <= N; i++) {
      for (int j = i + 1; j <= N; j++) {
        long long total = j - i;
        long long diff = abs(A[i] - A[j]);
        long long req = (diff + total - 1) / total;
        if (req <= mid) dp[j] = max(dp[i] + 1, dp[j]);
      }
    }
    int ok = 0;
    for (int i = 1; i <= N; i++) {
      if (dp[i] >= N - K) {
        ok = 1;
        break;
      }
    }
    if (ok) {
      res = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  cout << res << endl;
  return 0;
}
