#include <bits/stdc++.h>
using namespace std;
const long long sz = 2e5 + 5, mod = 1e9 + 7;
long long t, n, m, k, q;
long long power(long long a, long long b) {
  if (b < 0) b += mod - 1;
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long Inv(long long a) { return power(a, mod - 2); }
long long Binary(long long l, long long r, vector<long long> &v) {
  if (l == r) return l;
  long long m = (l + r) / 2;
  long long dp[2][n];
  dp[0][0] = 0;
  for (long long i = 1; i < n; i++) {
    long long x = 0;
    dp[0][i] = i;
    for (long long j = i - 1; j >= 0; j--) {
      if (abs(v[j] - v[i]) <= (i - j) * m) {
        dp[0][i] = min(dp[0][i], x + dp[0][j]);
      }
      x++;
    }
  }
  dp[1][n - 1] = 0;
  long long mn = dp[0][n - 1];
  for (long long i = n - 2; i >= 0; i--) {
    long long x = 0;
    dp[1][i] = n - i - 1;
    for (long long j = i + 1; j < n; j++) {
      if (abs(v[j] - v[i]) <= (j - i) * m) {
        dp[1][i] = min(dp[1][i], x + dp[1][j]);
      }
      x++;
    }
    mn = min(mn, dp[0][i] + dp[1][i]);
  }
  if (mn <= k) return Binary(l, m, v);
  return Binary(m + 1, r, v);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  t = 1;
  while (t--) {
    cin >> n >> k;
    vector<long long> v(n);
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
    }
    cout << Binary(0, 3e9, v);
  }
  return 0;
}
