#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
long long upmin(T1 &x, T2 v) {
  if (x > v) {
    x = v;
    return 1;
  }
  return 0;
}
template <class T1, class T2>
long long upmax(T1 &x, T2 v) {
  if (x < v) {
    x = v;
    return 1;
  }
  return 0;
}
const long long INF = 0x3f3f3f3f;
long long N, K;
vector<long long> A;
void init() {
  cin >> N >> K;
  A = vector<long long>(N);
  for (long long i = 0; i < N; ++i) {
    cin >> A[i];
  }
}
void preprocess() {}
long long ok(long long x) {
  vector<long long> dp(N + 1);
  for (long long i = 0; i <= N; ++i) {
    dp[i] = i;
  }
  for (long long i = 0; i < N; ++i) {
    for (long long j = i + 1; j <= N; ++j) {
      if (j == N or abs(A[j] - A[i]) <= 1LL * x * (j - i)) {
        upmin(dp[j], dp[i] + j - i - 1);
      }
    }
  }
  return min(dp[N - 1], dp[N]) <= K;
}
void solve() {
  long long ans = -1;
  for (long long lb = 0, rb = (long long)2e9; lb <= rb;) {
    long long mid = lb + rb >> 1;
    if (ok(mid)) {
      ans = mid;
      rb = mid - 1;
    } else {
      lb = mid + 1;
    }
  }
  cout << ans << endl;
}
signed main() {
  ios::sync_with_stdio(0);
  init();
  preprocess();
  solve();
  return 0;
}
