#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000007;
const long long linf = 1000000000000000000LL;
const double eps = 0.000001;
const double pi = 3.14159265358979323846;
template <class T>
T abs(T k) {
  return k >= 0 ? k : -k;
}
template <class T>
T sqr(T n) {
  return n * n;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T mod(T a, T b) {
  return (a % b + b) % b;
}
template <class T>
void mode(T &a, T b) {
  a = mod(a, b);
}
template <class T>
void maxe(T &a, T b) {
  a = max(a, b);
}
template <class T>
void mine(T &a, T b) {
  a = min(a, b);
}
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const int N = 1000010;
int test;
int n, m, k, ans;
int a[N], b[N];
int cnt[N];
int check(int m) {
  int s = 0;
  for (int i = m; i < N; i += m) s += b[i];
  if (s > k * (k + 1) / 2) return 0;
  int t = 0;
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < n; i++) {
    t += (cnt[a[i] % m] != 0);
    if (t > k) return 0;
    cnt[a[i] % m]++;
  }
  return 1;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) b[abs(a[i] - a[j])]++;
  ans = 1;
  while (!check(ans)) ans++;
  printf("%d\n", ans);
  return 0;
}

### Prompt

Generate 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;
const int inf = 1000000007;
const long long linf = 1000000000000000000LL;
const double eps = 0.000001;
const double pi = 3.14159265358979323846;
template <class T>
T abs(T k) {
  return k >= 0 ? k : -k;
}
template <class T>
T sqr(T n) {
  return n * n;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T mod(T a, T b) {
  return (a % b + b) % b;
}
template <class T>
void mode(T &a, T b) {
  a = mod(a, b);
}
template <class T>
void maxe(T &a, T b) {
  a = max(a, b);
}
template <class T>
void mine(T &a, T b) {
  a = min(a, b);
}
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const int N = 1000010;
int test;
int n, m, k, ans;
int a[N], b[N];
int cnt[N];
int check(int m) {
  int s = 0;
  for (int i = m; i < N; i += m) s += b[i];
  if (s > k * (k + 1) / 2) return 0;
  int t = 0;
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < n; i++) {
    t += (cnt[a[i] % m] != 0);
    if (t > k) return 0;
    cnt[a[i] % m]++;
  }
  return 1;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) b[abs(a[i] - a[j])]++;
  ans = 1;
  while (!check(ans)) ans++;
  printf("%d\n", ans);
  return 0;
}

```