Codeforces Round 183 (Div. 1)
翻译中…
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:
.
翻译中…
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 $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ $(0 ≤ *a*_{*i*} ≤ 10^{6})$.
翻译中…
Output
翻译中…
Print a single positive integer — the minimum $*m*$.
翻译中…
样例
Input #1
7 0
0 2 3 6 7 12 18
Output #1
13
InputCopy
OutputCopy
Input #2
7 1
0 2 3 6 7 12 18
Output #2
7
InputCopy
OutputCopy
题目信息
标签
暴力
图论
数学
数论
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。