#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2000 + 10;
long long n, k, arr[MAXN], max_d;
long long dp[MAXN];
bool good(long long d) {
  for (long long i = 0; i < n; i++) {
    dp[i] = i;
    for (long long j = 0; j < i; j++)
      if ((abs(arr[i] - arr[j]) + (i - j) - 1) / (i - j) <= d)
        (dp[i]) = min((dp[i]), (dp[j] + (i - j - 1)));
  }
  for (long long j = 0; j < n; j++)
    if (dp[j] + (n - j - 1) <= k) return true;
  return (k == n);
}
long long bs() {
  long long l = -1, r = max_d;
  while (r - l > 1) {
    long long mid = (r + l) / 2;
    if (good(mid))
      r = mid;
    else
      l = mid;
  }
  return r;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    if (i) (max_d) = max((max_d), (abs(arr[i] - arr[i - 1])));
  }
  cout << bs() << endl;
  return 0;
}
