#include <bits/stdc++.h>
using namespace std;
long long Ile(vector<long long>& a, long long s) {
  int n = a.size();
  vector<long long> dp(n);
  for (int i = 0; i < n; ++i) {
    dp[i] = i;
    for (int j = 0; j < i; ++j) {
      bool ok = false;
      if (a[j] == a[i]) ok = true;
      if (a[j] < a[i]) {
        long long ost = a[j] + (i - j - 1) * s;
        if (ost < a[i])
          if (a[i] - ost <= s) ok = true;
        if (ost >= a[i]) ok = true;
      }
      if (a[j] > a[i]) {
        long long ost = a[j] - (i - j - 1) * s;
        if (ost > a[i])
          if (ost - a[i] <= s) ok = true;
        if (ost <= a[i]) ok = true;
      }
      if (ok) dp[i] = min(dp[i], dp[j] + (i - j - 1));
    }
  }
  long long ile = n;
  for (int i = 0; i < n; ++i) ile = min(ile, dp[i] + (n - i - 1));
  return ile;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long l = 0, p = 1000000000000, s, r = -1;
  while (l <= p) {
    s = (l + p) / 2;
    if (Ile(a, s) <= k) {
      r = s;
      p = s - 1;
    } else
      l = s + 1;
  }
  cout << r;
  return 0;
}
