#include <bits/stdc++.h>
using namespace std;
int a[2333], dp[2333], n, k;
bool check(long long x) {
  for (int i = 0; i < n; i++) dp[i] = i;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (abs(a[i] - a[j]) <= (j - i) * x) {
        dp[j] = min(dp[j], dp[i] + j - i - 1);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (dp[i] + n - i - 1 <= k) return true;
  }
  return false;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  long long l = 0, r = 12333333333, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << l << endl;
  return 0;
}
