#include <bits/stdc++.h>
using namespace std;
int n, k, a[2010], dp[2010];
long long l, r, mid, ans;
bool check(long long x) {
  for (int i = 1; i <= n; i++) {
    dp[i] = i;
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      if (abs(a[i] - a[j]) <= x * (i - j)) {
        dp[i] = min(dp[i], dp[j] + i - j - 1);
      }
    }
  }
  int res = n;
  for (int i = 1; i <= n; i++) {
    res = min(res, dp[i] + n - i - 1);
  }
  return res <= k;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  l = 0, r = 2e9;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
