跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F2451. Minimum Modular

    ID: 2457 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>枚举图论数学数论算法思想挑战难度共享题库Codeforces英文题面题目来源题面语言

Minimum Modular

题目描述

C. Minimum Modular
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

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: .

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

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 2082 题。保留原作者与原赛事署名。