#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  x = 0;
  char ch;
  bool flag = false;
  while (ch = getchar(), ch < '!')
    ;
  if (ch == '-') ch = getchar(), flag = true;
  while (x = 10 * x + ch - '0', ch = getchar(), ch > '!')
    ;
  if (flag) x = -x;
}
inline int cat_max(const int &a, const int &b) { return a > b ? a : b; }
inline int cat_min(const int &a, const int &b) { return a < b ? a : b; }
const int maxn = 1000011;
int n, k, a[maxn], f[maxn], b[maxn];
int main() {
  read(n);
  read(k);
  for (int i = 1; i <= n; ++i) read(a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      f[a[j] - a[i]]++;
    }
  }
  int p, cnt, res, i;
  for (p = 1;; ++p) {
    cnt = res = 0;
    for (i = p; i < maxn; i += p) cnt += f[i];
    if (cnt > (k * (k + 1) / 2)) continue;
    for (i = 1; i <= n; ++i) {
      if (b[a[i] % p] == p) ++res;
      b[a[i] % p] = p;
    }
    if (res <= k) break;
  }
  printf("%d\n", p);
  getchar();
  getchar();
  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;
inline void read(int &x) {
  x = 0;
  char ch;
  bool flag = false;
  while (ch = getchar(), ch < '!')
    ;
  if (ch == '-') ch = getchar(), flag = true;
  while (x = 10 * x + ch - '0', ch = getchar(), ch > '!')
    ;
  if (flag) x = -x;
}
inline int cat_max(const int &a, const int &b) { return a > b ? a : b; }
inline int cat_min(const int &a, const int &b) { return a < b ? a : b; }
const int maxn = 1000011;
int n, k, a[maxn], f[maxn], b[maxn];
int main() {
  read(n);
  read(k);
  for (int i = 1; i <= n; ++i) read(a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      f[a[j] - a[i]]++;
    }
  }
  int p, cnt, res, i;
  for (p = 1;; ++p) {
    cnt = res = 0;
    for (i = p; i < maxn; i += p) cnt += f[i];
    if (cnt > (k * (k + 1) / 2)) continue;
    for (i = 1; i <= n; ++i) {
      if (b[a[i] % p] == p) ++res;
      b[a[i] % p] = p;
    }
    if (res <= k) break;
  }
  printf("%d\n", p);
  getchar();
  getchar();
  return 0;
}

```