#include <bits/stdc++.h>
using namespace std;
struct timer {
  time_t start;
  timer() { start = clock(); }
  ~timer() {
    cerr << 1. * (clock() - start) / CLOCKS_PER_SEC << " secs" << endl;
  }
};
int n, a[5010], K;
int dif[1000010];
bool mod[1000010];
vector<int> v;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> K;
  for (int i = 0; i < (n); i++) cin >> a[i];
  if (K >= n) {
    cout << 1;
    return 0;
  }
  for (int i = 0; i < (n); i++)
    for (int j = i + 1; j < (n); j++) dif[abs(a[i] - a[j])]++;
  int D = *max_element(a, a + n) - *min_element(a, a + n);
  for (int i = 1; i < (1070000000LL); i++) {
    int edge = 0, num = 0;
    for (int j = i; j <= D; j += i) {
      edge += dif[j];
      if (edge > (K + 1) * K / 2) goto fail;
    }
    for (int j = 0; j < (n); j++) {
      int m = a[j] % i;
      if (mod[m]) {
        num++;
        if (num > K) goto fail;
      } else {
        mod[m] = 1;
        v.push_back(m);
      }
    }
    cout << i;
    return 0;
  fail:;
    for (int i = 0; i < (((int)v.size())); i++) mod[v[i]] = 0;
    v.clear();
  }
}

### Prompt

Your task is to create a CPP solution to the following problem:

You have been given n distinct integers a1, a2, ..., an. You can remove at most k of them. Find the minimum modular m (m > 0), so that for every pair of the remaining integers (ai, aj), the following unequality holds: <image>.

Input

The first line contains two integers n and k (1 ≤ n ≤ 5000, 0 ≤ k ≤ 4), which we have mentioned above. 

The second line contains n distinct integers a1, a2, ..., an (0 ≤ ai ≤ 106).

Output

Print a single positive integer — the minimum m.

Examples

Input

7 0
0 2 3 6 7 12 18


Output

13


Input

7 1
0 2 3 6 7 12 18


Output

7

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
struct timer {
  time_t start;
  timer() { start = clock(); }
  ~timer() {
    cerr << 1. * (clock() - start) / CLOCKS_PER_SEC << " secs" << endl;
  }
};
int n, a[5010], K;
int dif[1000010];
bool mod[1000010];
vector<int> v;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> K;
  for (int i = 0; i < (n); i++) cin >> a[i];
  if (K >= n) {
    cout << 1;
    return 0;
  }
  for (int i = 0; i < (n); i++)
    for (int j = i + 1; j < (n); j++) dif[abs(a[i] - a[j])]++;
  int D = *max_element(a, a + n) - *min_element(a, a + n);
  for (int i = 1; i < (1070000000LL); i++) {
    int edge = 0, num = 0;
    for (int j = i; j <= D; j += i) {
      edge += dif[j];
      if (edge > (K + 1) * K / 2) goto fail;
    }
    for (int j = 0; j < (n); j++) {
      int m = a[j] % i;
      if (mod[m]) {
        num++;
        if (num > K) goto fail;
      } else {
        mod[m] = 1;
        v.push_back(m);
      }
    }
    cout << i;
    return 0;
  fail:;
    for (int i = 0; i < (((int)v.size())); i++) mod[v[i]] = 0;
    v.clear();
  }
}

```