#include <bits/stdc++.h>
const int N = 2048, MOD = 1e9 + 7, INF = 0x7fffffff;
using namespace std;
int data[N], dp[N];
int n, m;
bool find(int k) {
  for (int i = 1; i <= n; ++i) {
    dp[i] = i - 1;
    for (int j = 1; j < i; ++j)
      if (abs(data[j] - data[i]) <= (i - j) * (long long)k)
        dp[i] = min(dp[i], dp[j] + i - j - 1);
    if (dp[i] + n - i <= m) return true;
  }
  return dp[n] <= m;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", data + i);
  long long l, r, mid;
  l = 0;
  r = MOD + MOD;
  while (l < r) {
    mid = (l + r) >> 1;
    if (find(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%I64d\n", l);
  return 0;
}
