#include <bits/stdc++.h>
using namespace std;
int N, k;
int a[5010];
int ll[1000000 + 1];
int val[1000000 + 1][5];
int main() {
  cin >> N >> k;
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  for (int* i = a; i < a + N; i++)
    for (int* j = i + 1; j < a + N; j++) {
      int x = (*j) - (*i);
      if (ll[x] == 5) continue;
      val[x][ll[x]] = *i;
      ll[x]++;
    }
  for (int m = max(1, N - 2 * k); m <= 1000000 + 1; m++) {
    set<int> qq;
    for (int j = m; j <= 1e6; j += m) {
      for (int i = 0; i < ll[j]; i++) {
        int x = val[j][i];
        qq.insert(x);
      }
      if (int(qq.size()) > k) break;
    }
    if (int(qq.size()) <= k) {
      cout << m << "\n";
      break;
    }
  }
}

### Prompt

Please provide a CPP coded solution to the problem described below:

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 N, k;
int a[5010];
int ll[1000000 + 1];
int val[1000000 + 1][5];
int main() {
  cin >> N >> k;
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  for (int* i = a; i < a + N; i++)
    for (int* j = i + 1; j < a + N; j++) {
      int x = (*j) - (*i);
      if (ll[x] == 5) continue;
      val[x][ll[x]] = *i;
      ll[x]++;
    }
  for (int m = max(1, N - 2 * k); m <= 1000000 + 1; m++) {
    set<int> qq;
    for (int j = m; j <= 1e6; j += m) {
      for (int i = 0; i < ll[j]; i++) {
        int x = val[j][i];
        qq.insert(x);
      }
      if (int(qq.size()) > k) break;
    }
    if (int(qq.size()) <= k) {
      cout << m << "\n";
      break;
    }
  }
}

```