AtCoder Regular Contest 148
A
mod M
AtCoder
⌀ 656
原题
←B →
翻译中…

Problem Statement

翻译中…

You are given a sequence $A = (A_1, A_2, ..., A_N)$. You may perform the following operation exactly once.

翻译中…
  • Choose an integer $M$ at least $2$. Then, for every integer $i$ ($1 \leq i \leq N$), replace $A_i$ with the remainder when $A_i$ is divided by $M$.
翻译中…

For instance, if $M = 4$ is chosen when $A = (2, 7, 4)$, $A$ becomes $(2 \bmod 4, 7 \bmod 4, 4 \bmod 4) = (2, 3, 0)$.

翻译中…

Find the minimum possible number of different elements in $A$ after the operation.

翻译中…

Constraints

翻译中…
  • $2 \leq N \leq 2 \times 10^5$
  • $0 \leq A_i \leq 10^9$
  • All values in the input are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N
A_1 A_2 \dots A_N

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
3
1 4 8
Output #1
2
If you choose $M = 3$, you will have $A = (1 \bmod 3, 4 \bmod 3, 8 \bmod 3) = (1, 1, 2)$, where $A$ contains two different elements. The number of different elements in $A$ cannot become $1$, so the answer is $2$.
Input #2
4
5 10 15 20
Output #2
1
If you choose $M = 5$, you will have $A = (0, 0, 0, 0)$, which is optimal.
Input #3
10
3785 5176 10740 7744 3999 3143 9028 2822 4748 6888
Output #3
1
题目信息
题号
arc148_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。