303_C. Minimum Modular_5222
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


import java.io.*;

public class tmo {
	public static void main(String[] args) throws IOException {
		StreamTokenizer in = new StreamTokenizer(new BufferedReader(
				new InputStreamReader(System.in)));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		in.nextToken();
		int n = (int) in.nval;
		in.nextToken();
		int k = (int) in.nval;
		int[] a = new int[n];
//		int maxa = 0;
//		int mina = 10000000;
		for (int i = 0; i < n; i++) {
			in.nextToken();
			a[i] = (int) in.nval;
//			if (a[i] > maxa)
//				maxa = a[i];
//			if (a[i] < mina)
//				mina = a[i];
		}
//		int r = maxa - mina + 1;
		int p = k * (k + 1) / 2;
		int[] delta = new int[1000001];
		int[] test = new int[1000000 + 1];
		for (int i = 0; i < (n - 1); i++)
			for (int j = i + 1; j < n; j++)
				delta[Math.abs(a[i] - a[j])]++;
		for (int i = 1;; i++) {
			int ch = 0;
			for (int j = i; j <= 1000000; j += i) {
				ch += delta[j];
				if (ch > p)
					break;
			}
			if (ch <= p) {
				if (ch <= 1) {
					out.println(i);
					break;
				} else {
					ch = 0;
					for (int l = 0; l < n; l++)
						if (test[a[l] % i] == i)
							ch++;
						else
							test[a[l] % i] = i;
					if (ch <= k) {
						out.println(i);
						break;
					}
				}
			}
		}
		out.flush();
	}
}