#include <bits/stdc++.h>
using namespace std;
long long dx[] = {0, 0, 1, -1};
long long dy[] = {1, -1, 0, 0};
const long long sz = 100005;
long long arr[2001];
long long k, n;
bool isPossible(long long x) {
  long long dp[2001] = {0};
  for (long long i = 1; i < n; i++) {
    for (long long j = 0; j < i; j++) {
      if (abs(arr[i] - arr[j]) <= (i - j) * x) {
        dp[i] = max(dp[j] + 1, dp[i]);
      }
    }
  }
  long long max_transaction = 0;
  for (long long i = 0; i < n; i++) {
    max_transaction = max(max_transaction, dp[i]);
  }
  long long min_transactions = (n - 1) - max_transaction;
  return min_transactions <= k;
}
long long solve() {
  long long s = 0;
  long long e = 1e12;
  while (s <= e) {
    long long mid = (s + e) / 2;
    if (isPossible(mid)) {
      e = mid - 1;
    } else {
      s = mid + 1;
    }
  }
  return s;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> arr[i];
  cout << solve();
  return 0;
}
