#include <bits/stdc++.h>
using namespace std;
int b[1200000], c[1200000], g[10000];
int i, j, m, n, r, t;
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &g[i]);
  sort(g + 1, g + n + 1);
  for (i = 1; i < n; i++)
    for (j = i + 1; j <= n; j++) b[g[j] - g[i]]++;
  for (i = 1; i <= 1000000; i++) {
    t = 0;
    for (j = i; j <= 1000000; j = j + i) t = t + b[j];
    if (t > m * (m + 1) / 2) continue;
    t = 0;
    for (j = 1; j <= n; j++)
      if (c[g[j] % i] != i)
        c[g[j] % i] = i;
      else
        t++;
    if (t <= m) break;
  }
  printf("%d", i);
  return 0;
}

### Prompt

Your challenge is to write 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 b[1200000], c[1200000], g[10000];
int i, j, m, n, r, t;
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &g[i]);
  sort(g + 1, g + n + 1);
  for (i = 1; i < n; i++)
    for (j = i + 1; j <= n; j++) b[g[j] - g[i]]++;
  for (i = 1; i <= 1000000; i++) {
    t = 0;
    for (j = i; j <= 1000000; j = j + i) t = t + b[j];
    if (t > m * (m + 1) / 2) continue;
    t = 0;
    for (j = 1; j <= n; j++)
      if (c[g[j] % i] != i)
        c[g[j] % i] = i;
      else
        t++;
    if (t <= m) break;
  }
  printf("%d", i);
  return 0;
}

```