题号:NC223597
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
For a given set

, we called a hash function
perfect hash function of S, if it satisfies
%20%5Cneq%20f_S(a_j))
.
Given a set S with non-negative integers, please find the minimum
positive integer seed that function
%20%3D%20x%20%5Cmod%20seed)
is a perfect hash function of S.
Note: Six more test cases are added after contest.
输入描述:
The first line of input contains one integer $n$, describing the size of set S.
The second line contains
integers
, describing the elements in S.
It is guaranteed that
.
输出描述:
Output one integer in a line, indicating the answer.
示例3
输入
复制
10
0 7 23 18 29 27 6 28 24 11