#include <bits/stdc++.h>
using namespace std;
long long x, y, i, j, k, l, r, m, s, t, n, b[1234567], a[323456], z, d[222222],
    c[1223456], f[1112345], g[1123456];
string p, q, qq;
int main() {
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      b[a[j] - a[i]]++;
    }
  }
  m = max(1ll, n - k);
  while (m) {
    s = 0;
    for (i = m; i <= 1111111; i += m) {
      s += b[i];
    }
    if (s > k * (k + 1) / 2) {
      m++;
      continue;
    }
    s = 0;
    for (i = 0; i < n; i++) {
      if (c[a[i] % m] == m) s++;
      c[a[i] % m] = m;
    }
    if (s <= k) {
      cout << m;
      return 0;
    }
    m++;
  }
  cout << m;
  return 0;
}

### Prompt

Please create a solution in CPP 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;
long long x, y, i, j, k, l, r, m, s, t, n, b[1234567], a[323456], z, d[222222],
    c[1223456], f[1112345], g[1123456];
string p, q, qq;
int main() {
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      b[a[j] - a[i]]++;
    }
  }
  m = max(1ll, n - k);
  while (m) {
    s = 0;
    for (i = m; i <= 1111111; i += m) {
      s += b[i];
    }
    if (s > k * (k + 1) / 2) {
      m++;
      continue;
    }
    s = 0;
    for (i = 0; i < n; i++) {
      if (c[a[i] % m] == m) s++;
      c[a[i] % m] = m;
    }
    if (s <= k) {
      cout << m;
      return 0;
    }
    m++;
  }
  cout << m;
  return 0;
}

```