#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n, k;
int last[1000005], cnt[1000005];
int ar[5005];
bool fail[1000005];
int id[30000000], nxt[30000000], head[1000005];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> ar[i];
  sort(ar, ar + n);
  int m = 0;
  memset(head, -1, sizeof(head));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      int dif = ar[i] - ar[j];
      nxt[m] = head[dif];
      id[m] = i;
      head[dif] = m++;
      ++cnt[dif];
    }
  }
  for (int i = 1; i <= 1000000; ++i) {
    int es = 0;
    for (int j = i; j <= 1000000; j += i) es += cnt[j];
    if (es <= 10) {
      int cnt = 0;
      for (int j = i; j <= 1000000; j += i)
        for (int k = head[j]; k != -1; k = nxt[k]) {
          if (last[id[k]] != i) {
            ++cnt;
            last[id[k]] = i;
          }
        }
      if (cnt <= k) {
        printf("%d\n", i);
        return 0;
      }
    }
  }
  return 0;
}

### Prompt

Please formulate 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;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n, k;
int last[1000005], cnt[1000005];
int ar[5005];
bool fail[1000005];
int id[30000000], nxt[30000000], head[1000005];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> ar[i];
  sort(ar, ar + n);
  int m = 0;
  memset(head, -1, sizeof(head));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      int dif = ar[i] - ar[j];
      nxt[m] = head[dif];
      id[m] = i;
      head[dif] = m++;
      ++cnt[dif];
    }
  }
  for (int i = 1; i <= 1000000; ++i) {
    int es = 0;
    for (int j = i; j <= 1000000; j += i) es += cnt[j];
    if (es <= 10) {
      int cnt = 0;
      for (int j = i; j <= 1000000; j += i)
        for (int k = head[j]; k != -1; k = nxt[k]) {
          if (last[id[k]] != i) {
            ++cnt;
            last[id[k]] = i;
          }
        }
      if (cnt <= k) {
        printf("%d\n", i);
        return 0;
      }
    }
  }
  return 0;
}

```