#include <bits/stdc++.h>
using namespace std;
const int oo = 2000000001;
vector<int> Values;
int N, K, Solution;
inline int Abs(const int value) {
  if (value < 0) return -value;
  return value;
}
bool CanAssign(const int maxDifference) {
  vector<int> DP[2];
  DP[0] = DP[1] = vector<int>(N, N);
  DP[0][0] = 0;
  DP[1][0] = 1;
  for (int n = 1; n < N; ++n) {
    DP[0][n] = n;
    for (int replace = 0; replace + 1 <= n && replace < DP[0][n]; ++replace) {
      int difference = Abs(Values[n] - Values[n - replace - 1]);
      int newDifference = difference / (replace + 1);
      if (difference % (replace + 1) != 0) ++newDifference;
      if (newDifference <= maxDifference)
        DP[0][n] = min(DP[0][n], DP[0][n - replace - 1] + replace);
    }
    DP[1][n] = min(DP[0][n - 1], DP[1][n - 1]) + 1;
  }
  return (DP[0][N - 1] <= K || DP[1][N - 1] <= K);
}
void Solve() {
  Solution = oo;
  int left = 0, right = oo;
  while (left <= right) {
    int middle = (1LL * left + 1LL * right) / 2LL;
    if (CanAssign(middle)) {
      right = middle - 1;
      Solution = middle;
    } else {
      left = middle + 1;
    }
  }
}
void Read() {
  cin >> N >> K;
  Values = vector<int>(N);
  for (int i = 0; i < N; ++i) cin >> Values[i];
}
void Print() { cout << Solution << "\n"; }
int main() {
  Read();
  Solve();
  Print();
  return 0;
}
