#include <bits/stdc++.h>
using namespace std;
long long read() {
  char x = getchar();
  long long ans = 0, flag = 1;
  while (!isdigit(x))
    if (x == '-')
      flag = -1, x = getchar();
    else
      x = getchar();
  while (isdigit(x)) ans = ans * 10 + x - '0', x = getchar();
  return ans * flag;
}
long long n, k, a[2005], dp[2005];
signed main() {
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long l = 0, r = 2e9, mid, ans = -1;
  while (l <= r) {
    mid = (l + r) >> 1;
    for (long long i = 1; i <= n; i++) dp[i] = 1;
    for (long long i = 2; i <= n; i++) {
      for (long long j = 1; j < i; j++) {
        if (abs(a[i] - a[j]) <= (i - j) * mid) dp[i] = max(dp[i], dp[j] + 1);
      }
    }
    bool flag = 0;
    for (long long i = 1; i <= n; i++) {
      if (n - dp[i] <= k) {
        flag = 1;
        break;
      }
    }
    if (flag)
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  cout << ans;
  return 0;
}
