#include <bits/stdc++.h>
using namespace std;
int b[1000100][10];
int i, j, n, k, mx, f[5050], h[1000100], size[1000100];
int main() {
  scanf("%d %d", &n, &k);
  for (i = 1; i <= n; i++) scanf("%d", f + i);
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) {
      int t = abs(f[i] - f[j]);
      mx = max(mx, t);
      if (size[t] <= k) b[t][++size[t]] = j;
    }
  for (i = 1;; i++) {
    int cnt = 0;
    for (j = i; j <= mx; j += i) {
      for (int e = 1; e <= size[j]; e++)
        if (h[b[j][e]] != i) cnt++, h[b[j][e]] = i;
      if (cnt > k) break;
    }
    if (cnt > k) continue;
    printf("%d\n", i);
    return 0;
  }
  return 0;
}

### Prompt

Please create a solution in Cpp 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;
int b[1000100][10];
int i, j, n, k, mx, f[5050], h[1000100], size[1000100];
int main() {
  scanf("%d %d", &n, &k);
  for (i = 1; i <= n; i++) scanf("%d", f + i);
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) {
      int t = abs(f[i] - f[j]);
      mx = max(mx, t);
      if (size[t] <= k) b[t][++size[t]] = j;
    }
  for (i = 1;; i++) {
    int cnt = 0;
    for (j = i; j <= mx; j += i) {
      for (int e = 1; e <= size[j]; e++)
        if (h[b[j][e]] != i) cnt++, h[b[j][e]] = i;
      if (cnt > k) break;
    }
    if (cnt > k) continue;
    printf("%d\n", i);
    return 0;
  }
  return 0;
}

```