#include <bits/stdc++.h>
using namespace std;
int S[1000005], G;
int flag[1000005], vis[1000005], a[1000005], Case, n, i, j, k, L, T, now;
void Insert(int d, int x, int y) {
  if (flag[d]) return;
  if ((++S[d]) > L * (L + 1) / 2) flag[d] = 1;
}
int main() {
  scanf("%d%d", &n, &L);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]), T = max(T, a[i]);
  sort(a + 1, a + n + 1);
  for (i = 1; i < n; i++)
    for (j = i + 1; j <= n; j++) Insert(a[j] - a[i], i, j);
  for (i = 1; i <= T + 1; i++) {
    G = 0;
    for (j = i; j <= T; j += i) {
      if (flag[j]) break;
      G += S[j];
      if (G > L * (L + 1) / 2) break;
    }
    if (j > T) {
      ++Case;
      now = L;
      for (k = 1; k <= n && now >= 0; k++)
        if (vis[a[k] % i] == Case)
          --now;
        else
          vis[a[k] % i] = Case;
      if (now < 0) continue;
      return printf("%d\n", i), 0;
    }
  }
}

### Prompt

Construct a cpp code solution to the problem outlined:

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 S[1000005], G;
int flag[1000005], vis[1000005], a[1000005], Case, n, i, j, k, L, T, now;
void Insert(int d, int x, int y) {
  if (flag[d]) return;
  if ((++S[d]) > L * (L + 1) / 2) flag[d] = 1;
}
int main() {
  scanf("%d%d", &n, &L);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]), T = max(T, a[i]);
  sort(a + 1, a + n + 1);
  for (i = 1; i < n; i++)
    for (j = i + 1; j <= n; j++) Insert(a[j] - a[i], i, j);
  for (i = 1; i <= T + 1; i++) {
    G = 0;
    for (j = i; j <= T; j += i) {
      if (flag[j]) break;
      G += S[j];
      if (G > L * (L + 1) / 2) break;
    }
    if (j > T) {
      ++Case;
      now = L;
      for (k = 1; k <= n && now >= 0; k++)
        if (vis[a[k] % i] == Case)
          --now;
        else
          vis[a[k] % i] = Case;
      if (now < 0) continue;
      return printf("%d\n", i), 0;
    }
  }
}

```