atcoder#ARC082A. [ABC072C] Together
[ABC072C] Together
Score : points
Problem Statement
You are given an integer sequence of length , .
For each , you have three choices: add to , subtract from or do nothing.
After these operations, you select an integer and count the number of such that .
Maximize this count by making optimal choices.
Constraints
- is an integer.
Input
The input is given from Standard Input in the following format:
..
Output
Print the maximum possible number of such that .
7
3 1 4 1 5 9 2
4
For example, turn the sequence into and select to obtain , the maximum possible count.
10
0 1 2 3 4 5 6 7 8 9
3
1
99999
1