#include <bits/stdc++.h>
using namespace std;
const int N = 5005, M = 1e6 + 5;
int n, m, k, i, j, v[N], g[M], ax[M][11], ay[M][11];
int num[N], t, q[25], w[5];
void add(int x) {
  if (!num[x]) q[++t] = x;
  num[x]++;
}
int main() {
  scanf("%d%d", &n, &k);
  m = k * (k + 1) / 2;
  for (i = 1; i <= n; i++) scanf("%d", &v[i]);
  sort(v + 1, v + n + 1);
  int mx = v[n];
  for (i = 2; i <= n; i++)
    for (j = 1; j < i; j++)
      if (g[v[i] - v[j]] <= m) {
        int x = v[i] - v[j];
        ax[x][g[x]] = i;
        ay[x][g[x]] = j;
        g[x]++;
      }
  for (i = 1; i <= mx + 1; i++) {
    int sum = 0;
    for (j = i; j <= mx && sum <= m; j += i) sum += g[j];
    if (sum > m) continue;
    t = 0;
    for (j = i; j <= mx; j += i)
      for (int x = 0; x < g[j]; x++) add(ax[j][x]), add(ay[j][x]);
    w[1] = w[2] = w[3] = w[4] = 0;
    for (j = 1; j <= t; j++) w[num[q[j]]]++, num[q[j]] = 0;
    w[1] /= 2;
    w[2] /= 3;
    w[3] /= 4;
    w[4] /= 5;
    if (w[1] + 2 * w[2] + 3 * w[3] + 4 * w[4] > k) continue;
    printf("%d", i);
    return 0;
  }
}

### Prompt

Your task is to create 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 N = 5005, M = 1e6 + 5;
int n, m, k, i, j, v[N], g[M], ax[M][11], ay[M][11];
int num[N], t, q[25], w[5];
void add(int x) {
  if (!num[x]) q[++t] = x;
  num[x]++;
}
int main() {
  scanf("%d%d", &n, &k);
  m = k * (k + 1) / 2;
  for (i = 1; i <= n; i++) scanf("%d", &v[i]);
  sort(v + 1, v + n + 1);
  int mx = v[n];
  for (i = 2; i <= n; i++)
    for (j = 1; j < i; j++)
      if (g[v[i] - v[j]] <= m) {
        int x = v[i] - v[j];
        ax[x][g[x]] = i;
        ay[x][g[x]] = j;
        g[x]++;
      }
  for (i = 1; i <= mx + 1; i++) {
    int sum = 0;
    for (j = i; j <= mx && sum <= m; j += i) sum += g[j];
    if (sum > m) continue;
    t = 0;
    for (j = i; j <= mx; j += i)
      for (int x = 0; x < g[j]; x++) add(ax[j][x]), add(ay[j][x]);
    w[1] = w[2] = w[3] = w[4] = 0;
    for (j = 1; j <= t; j++) w[num[q[j]]]++, num[q[j]] = 0;
    w[1] /= 2;
    w[2] /= 3;
    w[3] /= 4;
    w[4] /= 5;
    if (w[1] + 2 * w[2] + 3 * w[3] + 4 * w[4] > k) continue;
    printf("%d", i);
    return 0;
  }
}

```