A9034. Minimum Modular
编程题
普及/提高-
知识点
题目描述
You have been given $n$ distinct integers $a_{1},a_{2},...,a_{n}$ . You can remove at most $k$ of them. Find the minimum modular $m$ $(m>0)$ , so that for every pair of the remaining integers $(a_{i},a_{j})$ , the following unequality holds: .
输入格式
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 $a_{1},a_{2},...,a_{n}$ $(0<=a_{i}<=10^{6})$ .
The second line contains $n$ distinct integers $a_{1},a_{2},...,a_{n}$ $(0<=a_{i}<=10^{6})$ .
输出格式
Print a single positive integer — the minimum $m$ .
输入输出样例
输入 #1
7 0 0 2 3 6 7 12 18
输出 #1
13
输入 #2
7 1 0 2 3 6 7 12 18
输出 #2
7