#include <bits/stdc++.h>
using namespace std;
const int max_n = 2011, inf = 1e9 + 100;
long long m[max_n];
int n, k;
int dp[max_n];
bool check(long long d) {
  for (int i = 0; i < n; ++i) {
    dp[i] = i;
  }
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      if (m[i] <= m[j] + d * (i - j) && m[i] >= m[j] - d * (i - j)) {
        dp[i] = min(dp[i], dp[j] + (i - j - 1));
      }
      if (i == n - 1) {
        dp[i] = min(dp[i], dp[j] + i - j);
      }
    }
  }
  return dp[n - 1] <= k;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> m[i];
  }
  long long l = 0, r = 2e9 + 100;
  if (check(0)) {
    cout << 0 << endl;
    return 0;
  }
  while (l + 1 < r) {
    long long mid = (l + r) / 2;
    if (check(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  cout << r << endl;
  return 0;
}
