#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[2001], f[2001];
long long l, r, ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  l = 0;
  r = 1000000000000000ll;
  ans = r;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    for (int i = 1; i <= n; i++) f[i] = i - 1;
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++)
        if (abs(a[j] - a[i]) <= (long long)(j - i) * mid)
          if (f[i] + j - i - 1 < f[j]) f[j] = f[i] + j - i - 1;
    int flag = 0;
    for (int i = 1; i <= n; i++)
      if (f[i] + n - i <= m) {
        flag = 1;
        break;
      }
    if (flag) {
      r = mid - 1;
      if (mid < ans) ans = mid;
    } else
      l = mid + 1;
  }
  printf("%I64d\n", ans);
}
