#include <bits/stdc++.h>
using namespace std;
int cnt[1000001];
int n, k;
int a[1000001];
int mod[1000001];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      ++cnt[a[j] - a[i]];
    }
  }
  int res = 1;
  for (;; ++res) {
    int cur = 0;
    for (int i = res; i <= 1000000; i += res) cur += cnt[i];
    if (cur > (k * (k + 1)) / 2) continue;
    cur = 0;
    for (int i = 1; i <= n; ++i) {
      if (mod[a[i] % res]) ++cur;
      ++mod[a[i] % res];
    }
    if (cur <= k) {
      cout << res;
      return 0;
    }
    memset(mod, 0, sizeof mod);
  }
}

### Prompt

In CPP, your task is to solve 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;
int cnt[1000001];
int n, k;
int a[1000001];
int mod[1000001];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      ++cnt[a[j] - a[i]];
    }
  }
  int res = 1;
  for (;; ++res) {
    int cur = 0;
    for (int i = res; i <= 1000000; i += res) cur += cnt[i];
    if (cur > (k * (k + 1)) / 2) continue;
    cur = 0;
    for (int i = 1; i <= n; ++i) {
      if (mod[a[i] % res]) ++cur;
      ++mod[a[i] % res];
    }
    if (cur <= k) {
      cout << res;
      return 0;
    }
    memset(mod, 0, sizeof mod);
  }
}

```