#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
long long sum[1000001];
long long ar[5001], val[1000001], id[1000001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a = 0, b, c, d, e = 0, f = 0, g, h = 0, x, y, z;
  cin >> a >> c;
  for (int i = (0); i < (a); ++i) cin >> ar[i];
  for (int i = (0); i < (a); ++i) {
    for (int j = (0); j < (i); ++j) {
      b = abs(ar[i] - ar[j]);
      sum[b]++;
    }
  }
  for (int i = (1); i < (1000002); ++i) {
    b = 0;
    for (int j = i; j <= 1000000; j += i) {
      b += sum[j];
    }
    if (b > (c * (c + 1) / 2)) continue;
    b = 0;
    for (int j = (0); j < (a); ++j) {
      d = ar[j] % i;
      if (id[d] == i)
        b++;
      else
        id[d] = i;
    }
    if (b <= c) {
      cout << i << endl;
      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;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
long long sum[1000001];
long long ar[5001], val[1000001], id[1000001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a = 0, b, c, d, e = 0, f = 0, g, h = 0, x, y, z;
  cin >> a >> c;
  for (int i = (0); i < (a); ++i) cin >> ar[i];
  for (int i = (0); i < (a); ++i) {
    for (int j = (0); j < (i); ++j) {
      b = abs(ar[i] - ar[j]);
      sum[b]++;
    }
  }
  for (int i = (1); i < (1000002); ++i) {
    b = 0;
    for (int j = i; j <= 1000000; j += i) {
      b += sum[j];
    }
    if (b > (c * (c + 1) / 2)) continue;
    b = 0;
    for (int j = (0); j < (a); ++j) {
      d = ar[j] % i;
      if (id[d] == i)
        b++;
      else
        id[d] = i;
    }
    if (b <= c) {
      cout << i << endl;
      return 0;
    }
  }
}

```