#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long arr[2001];
bool isPossible(long long x) {
  long long dp[2001] = {0};
  for (int i = 1; i < n; i++) {
    for (int 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 (int i = 0; i < n; i++) {
    max_transaction = max(max_transaction, dp[i]);
  }
  return (n - 1 - max_transaction) <= 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;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  ;
  cout << solve() << endl;
  ;
  return 0;
}
