#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool check(ll x, vector<int>& a, int k) {
  int n = (int)a.size();
  vector<int> dp(n, 1);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      if (abs(a[i] - a[j]) <= abs(i - j) * x) dp[i] = max(dp[i], dp[j] + 1);
    }
  }
  int mx = *max_element(dp.begin(), dp.end());
  return mx >= n - k;
}
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  ll l = 0, r = 1e15, ans = 1e15;
  while (l <= r) {
    ll m = l + r >> 1;
    if (check(m, a, k)) {
      ans = m;
      r = m - 1;
    } else
      l = m + 1;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
