#include <bits/stdc++.h>
using namespace std;
int c[1200000], save[5500];
bool flag[1200000];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &save[i]);
    sort(save + 1, save + n + 1);
    memset(c, 0, sizeof(c));
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++) {
        save[j] > save[i] ? c[save[j] - save[i]]++ : c[save[i] - save[j]]++;
      }
    int K = k * (k + 1) / 2;
    for (int i = 1; i <= save[n] + 1; i++) {
      int temp = 0;
      for (int j = i; j <= save[n] + 1; j += i) {
        temp += c[j];
        if (temp > K) break;
      }
      if (temp <= K) {
        int cnt = 0;
        memset(flag, 0, sizeof(flag));
        for (int j = 1; j <= n; j++) {
          int tt = save[j] % i;
          if (flag[tt]) {
            cnt++;
            if (cnt > k) break;
          }
          flag[tt] = 1;
        }
        if (cnt <= k) {
          printf("%d\n", i);
          break;
        }
      }
    }
  }
  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;
int c[1200000], save[5500];
bool flag[1200000];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &save[i]);
    sort(save + 1, save + n + 1);
    memset(c, 0, sizeof(c));
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++) {
        save[j] > save[i] ? c[save[j] - save[i]]++ : c[save[i] - save[j]]++;
      }
    int K = k * (k + 1) / 2;
    for (int i = 1; i <= save[n] + 1; i++) {
      int temp = 0;
      for (int j = i; j <= save[n] + 1; j += i) {
        temp += c[j];
        if (temp > K) break;
      }
      if (temp <= K) {
        int cnt = 0;
        memset(flag, 0, sizeof(flag));
        for (int j = 1; j <= n; j++) {
          int tt = save[j] % i;
          if (flag[tt]) {
            cnt++;
            if (cnt > k) break;
          }
          flag[tt] = 1;
        }
        if (cnt <= k) {
          printf("%d\n", i);
          break;
        }
      }
    }
  }
  return 0;
}

```