#include <bits/stdc++.h>
using namespace std;
long long n, k, a[2007], dp[2007];
bool check(long long x) {
  for (long long i = 1; i <= n; i++) dp[i] = i - 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j < i; j++) {
      if (1LL * abs(a[i] - a[j]) <= 1LL * x * (i - j))
        dp[i] = min(dp[i], dp[j] + i - j - 1);
    }
  }
  for (long long i = 2; i <= n; i++) dp[i] = min(dp[i], dp[i - 1] + 1);
  return (dp[n] <= k);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long l = 0, r = 2e9;
  long long mid = (l + r) / 2;
  while (l < r - 1) {
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
    mid = (l + r) / 2;
  }
  for (long long i = l; i <= r; i++) {
    if (check(i)) return cout << i, 0;
  }
}
