atcoder#ARC148A. [ARC148A] mod M
[ARC148A] mod M
Score : points
Problem Statement
You are given a sequence . You may perform the following operation exactly once.
- Choose an integer at least . Then, for every integer (), replace with the remainder when is divided by .
For instance, if is chosen when , becomes .
Find the minimum possible number of different elements in after the operation.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
3
1 4 8
2
If you choose , you will have , where contains two different elements. The number of different elements in cannot become , so the answer is .
4
5 10 15 20
1
If you choose , you will have , which is optimal.
10
3785 5176 10740 7744 3999 3143 9028 2822 4748 6888
1