#include <bits/stdc++.h>
using namespace std;
int sum[2100000];
bool viz[1000010];
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> in(n);
  for (int i = (0); i < int(n); i += 1) {
    cin >> in[i];
    for (int j = (0); j < int(i); j += 1) sum[abs(in[i] - in[j])]++;
  }
  for (int i = (1); i < int(1000000 + 1); i += 1) {
    int ss = 0;
    for (int j = (i); j < int(2100000); j += i) ss += sum[j];
    if (ss > k * (k + 1) / 2) continue;
    int sul = 0;
    for (int j = (0); j < int(in.size()); j += 1)
      sul += viz[in[j] % i], viz[in[j] % i] = 1;
    if (sul <= k) {
      cout << i;
      return 0;
    }
    for (int j = (0); j < int(in.size()); j += 1) viz[in[j] % i] = 0;
  }
  return 0;
}

### Prompt

Please formulate 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 sum[2100000];
bool viz[1000010];
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> in(n);
  for (int i = (0); i < int(n); i += 1) {
    cin >> in[i];
    for (int j = (0); j < int(i); j += 1) sum[abs(in[i] - in[j])]++;
  }
  for (int i = (1); i < int(1000000 + 1); i += 1) {
    int ss = 0;
    for (int j = (i); j < int(2100000); j += i) ss += sum[j];
    if (ss > k * (k + 1) / 2) continue;
    int sul = 0;
    for (int j = (0); j < int(in.size()); j += 1)
      sul += viz[in[j] % i], viz[in[j] % i] = 1;
    if (sul <= k) {
      cout << i;
      return 0;
    }
    for (int j = (0); j < int(in.size()); j += 1) viz[in[j] % i] = 0;
  }
  return 0;
}

```