Hash Function
题号: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 f_S(x) perfect hash function of S, if it satisfies .

Given a set S with non-negative integers, please find the minimum positive integer seed that function 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.
示例1

输入

复制
3
2 3 4

输出

复制
3
示例2

输入

复制
3
1 2 4

输出

复制
4
示例3

输入

复制
10
0 7 23 18 29 27 6 28 24 11

输出

复制
15